我想创建一个使用ASP MVC与以下网址网站:路线登记ASP MVC的一个简单的图书馆应用
/libraries ## displays a list of libraries
/libraries?pageIndex=1 ## a list of libraries with pagination
/libraries/1 ## the library with ID == 1
/libraries/1/books ## a list of books in the library 1
/libraries/1/books?pageIndex=0 ## a paged list of books in the library 1
/libraries/1/books/2 ## the book with ID == 2 in the library 1
/libraries/1/books/2/edit ## edit page for the book 2 in the library 1
什么是对RouteCollections和控制器注册的最佳方法?
是的,我同意两条路由注册,但是最好先用'URL = libraries/{libraryId}/{controller}/{id}/{action}'制作Controller = Books',然后'Controller = Libraries'没有那么强'URL = {controller}/{id}/{action}'。你怎么看待这件事? – Warlock