I want to build parent child
entities for the same entity class in Entity Framework Core
.
So I have a entity like this:
public class Definition
{
public int Id{ get; set; }
public int ParentId { get; set; }
public string Name { get; set; }
public bool Active { get; set; }
}
I want to set ParentId
as foreign key that refers another Definition
Entity as parent entity.
How can I do this?
Thanks