MVC n级路线构建
时间:2020-03-06 14:48:14 来源:igfitidea点击:
我想创建一个具有N级类别的产品目录
e.g. /Catalog/Category1/Category2/../SubCategoryN/Product/{ProductActions}/{ID} And at the same time be able to /Catalog/Category1/Category2/../SubCategoryN/{CategoryActions}
有可能吗?如果可以,怎么办?
解决方案
没有默认的Route类,但是我们可以通过从RouteBase派生自己的路由类。基本上,我们最终必须自己完成解析URL的所有工作,但是我们可以使用Route的源代码来入门。