In the current examples on ASP.NET MVC I see quite basic entities, with simple CRUD methods.
But I\'m not sure about what to do with more advanced models. Let me give an
Your design should initially focus on the entities. You have car
, employees
and inventory
. Write a controller for each one of these. That will give you the basic routes:
/cars/{action}/{id}
/employees/{action}/{id}
/inventory/{action}/{id}
From here you should be able to write a new route with a custom route constraint with the following structure:
/cars/{id}/part/{id}/
This is also slightly better than /cars/{id}/carpart/{id}
because the word car in carpart
is redundant. /car/.../part/
indicates that part is for a car.
Thinking about things like these for URI design is really important early on because changing the URI design later will break search engine indices, bookmarks and links.