I'm using Entity Framework
and here it's my entity Model:
Public class Document
{
Public int Id { get; set; }
Public Document Parent { get; set; }
}
and as you see that it has a self-reference
property.
Now I'm trying to add another self-reference
property like this:
Public class Document
{
Public int Id { get; set; }
Public Document Parent { get; set; }
Public Document SrcDocument { get; set; }
}
But unfortunately I've faced with below error:
Unable to determine the principal end of an association between the types 'Document' and 'Document'. The principal end of this association must be explicitly configured using either the relationship fluent API or data annotations.