I have a Category model with self reference
public class Category { public int Id { get; set; } public string Title { get; set; } public int? ParentId { get; set; } public Category Parent { get; set; } public virtual ICollection<Category> Children { get; set; } public virtual ICollection<PostCategory> PostCategories { get; set; } }