I've been searching for similar questions to mine, and I haven't found an answer to this yet.
I'm trying to relate a person class, to 2 other types of "Person" (SignificantOther and Match), but I'm getting the following error:
Unable to determine the principal end of an association between the types 'Namespace.Models.Person' and 'Namespace.Models.Person'.
Here is my class:
public class Person
{
public Person()
{
}
public int Id { get; set; }
public string FirstName { get; set; }
public string LastName { get; set; }
public Person SignificantOther { get; set; }
public Person Match { get; set; }
}
I tried using a foreign key data annotation, but that didn't work (maybe I did it wrong). I feel like there is a simple way, that I'm just overlooking. Any ideas?
I'm using code first, and LocalDb.