I have a table
Category
--------
Id
Name
ParentId (null)
Categories can be infinitely recursive, but probably maximum at about 3 levels, I want my URLs to appear in categories. So, if the table looked like this:
Id Name ParentId
1 Entertainment null
2 Sport 1
3 Football 2
My url will look like this:
http: // Localhost / Entertainment / Sport / Football
Categories often change too often, so it can be difficult to write them down as a last resort, but I really don't want to.
I found this answer
Routing hiearchical paths from a database using ASP.Net MVC
is another way to do this?
source
share