Unable to determine the principal end of an association between the types

That exception is launched because you are trying to configure an one-to-one relationship but you are not specifying which end is the principal in the relationship. Principal end is the one which will be inserted first and which can exist without the dependent one. Dependent end is the one which must be inserted after the principal because it has foreign key to the principal. To resolve this particular problem you can use the Required data annotation (I suppose the Quater entity is the dependent in this case):

public partial class Quater : ElectricConsumer
{   
  //...    
  [Required]
  public virtual Employee Employee { get; set; }
}

Leave a Comment