I have a Content class that must have a parent identifier for inheritance, but I also want it to have a list of child content that has nothing to do with this inheritance tree.
I basically need a link table as a ChildContentRelationship with an identifier for parentContent and childContent in it, and the Content class will have a list of ChildContentRelationship.
This caused a lot of errors.
Here waht i kinda wanna do
public class Content { public int Id { get; set; } public int? ParentContentId { get; set; } public virtual Content ParentContent { get; set; } public string Name { get; set; } public int ContentTypeId { get; set; } public virtual ContentType ContentType { get; set; } public virtual ICollection<Property> Properties { get; set; } public virtual ICollection<ChildContentRelationship> ChildContent { get; set; } }
How to set this to EF?
Dean nolan
source share