Quantcast
Channel: ASP.NET Core
Viewing all articles
Browse latest Browse all 9386

How to delete self referencing table data using entityframework

$
0
0

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; }

    }



Viewing all articles
Browse latest Browse all 9386

Trending Articles