Firstly, I know that there are many Unable to determine the principal end of an association between the types
error Unable to determine the principal end of an association between the types
, but ever the one that I see does not correspond to my problem if I missed one, sorry for that.
I built Entity, which ultimately refers to it myself twice, and when I put the code in the first link, it works fine, as soon as the ad code for the second one breaks. Performing some testing, I found that if I use them myself, then everything works fine only when I add a second self-promotion, which it breaks. The code I use for my own links:
[ForeignKey("ManagerID")] public User Manager { get; set; } //Auditing Fields public DateTime DateCreated { get; set; } public int? UpdatedByUserID { get; set; } public DateTime? DateUpdated { get; set; } public DateTime LastAutoUpdate { get; set; } [ForeignKey("UpdatedByUserID")] public User UpdatedByUser { get; set; }
Full code of the object code:
public class User { [DatabaseGenerated(DatabaseGeneratedOption.Identity)] public int ID { get; set; } public int ADPFileNumber { get; set; } [Required] public string ADUserName { get; set; } public int AirCardCheckInLateCount { get; set; } [Required] public string Email { get; set; } public DateTime? EndDate { get; set; } [Required] public string FirstName { get; set; } [Required] public string LastName { get; set; } public int ManagerID { get; set; } public string MobilePhone { get; set; } [Required] public string Office { get; set; } [Required] public string Phone { get; set; } public decimal PTO { get; set; } public DateTime StartDate { get; set; } public int VehicleCheckInLateCount { get; set; } public int WexCardDriverID { get; set; } [ForeignKey("ManagerID")] public User Manager { get; set; }
What am I missing because the second self-promotion is interrupted?
source share