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

multilevel categories in asp.net core mvc

$
0
0

Hello.

I am working on categories in my project an i need to create multi level menu for categories.

I am very confused in Model creating And inserting method

Model:(Category.cs)

int Id

String Title

Int ParentId

[ForeignKey("ParetId")]

Category ParentCategory

List<Category> Children

But when I use dotnet ef migrations add "migrationname"

I get error about cycle deletion and says I can not create migrations

I am using asp.net core 2 And entity framework core

What I want?

I want to have an create view to add new category with a dropdownlist to select parent category and if it is a parent set drop downlist as 0.

Then in a partial view get list of categories and show like multilevel ul li.

Please help me I am very confused, I searched many time but no good result :(


Viewing all articles
Browse latest Browse all 9386

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>