I am trying to figure out how to use MVC for a new project. The project will have the following architecture:
Multiple projects will be possible to create.
The database is shared meaning that there are tables: Projects, Classes, Students, Assignments.
The only thing that bothers me is the routing. With MVC you are supposed to use the pattern Controller/Action/Parameter but in this case it is not possible. The routing pattern that I want to use is something like Project/ProjectId/Controller/Parameter/Action
(project/1/class/1/edit
).
I read about areas but this won't give me the extra layer that I want. It will just add something like the following(project/class/1/edit
).
So how do you put together such things with MVC? Do I need to manually write every url pattern using the Route
attribute?
I tried that also but I found myself repeating the pattern
Route("/project/{projectId}/morestuffhere")
which makes me think that I am doing this the wrong way.