title: because they are not in the same type hierarchy or do not have a valid one to one foreign key relationship with matching primary keys between them
body: <p>I have implemented following generic model as base model and two models derived from it and i need one to many relationship. I have used fluent api to create the relationships but i get the error mentioned in the title.
  Would you please see if you find any thing wrong in my code.</p>
  
  <pre><code> public abstract class ModelBase&lt;T&gt; : BaseEntity, IModelBase&lt;T&gt;
  {
      public virtual T Id { get; set; }
  }
  
   [Table("VehicleModel", Schema = "Tracker")]
  public class VehicleModelModel : ModelBase&lt;int&gt;
  {
      public string Company { get; set; }
      public string ModelName { get; set; }
      public byte LiPerKM { get; set; }
      public virtual ICollection&lt;VehicleModel&gt; Vehicles { get; set; }
  
   [Table("Vehicle", Schema = "Tracker")]
  public class VehicleModel : ModelBase&lt;Guid&gt;
  {
      public string VehicleName { get; set; }
      public string LicensePlate { get; set; }
      public int VehicleModelId { get; set; }
      public virtual VehicleModelModel Model { get; set; }
      public virtual TrackerModel Tracker { get; set; }
      [Required]
      public virtual DriverModel Driver { get; set; }
  
  modelBuilder.Entity&lt;VehicleModel&gt;()
                      .HasRequired&lt;VehicleModelModel&gt;(s =&gt; s.Model)
                      .WithMany(s =&gt; s.Vehicles)
                      .HasForeignKey(s =&gt; s.VehicleModelId);
  </code></pre>
  
  <p>Here I get this error:</p>
  
  <pre><code>entity types 'VehicleModelModel' and 'VehicleModel' cannot share table 'VehicleModels' because they are not in the same type hierarchy or do not have a valid one to one foreign key relationship with matching primary keys between them.
  </code></pre>