我有几个区域的系统。然后,我为我的控制器创建了一个文件夹结构(按照菜单结构),如下所示:
- Areas
- Area1
- Controllers
- Folder1
- Folder2
- Controller1
- Controller2
- Folder3
- Controller3
...
好的,到目前为止一切顺利......使用默认路由我得到了:
mysite.com/Area1/Controller1/Action
mysite.com/Area1/Controller3/Action
我想要实现的是这样的:
mysite.com/Area1/Folder1/Folder2/Controller1/Action
mysite.com/Area1/Folder1/Folder3/Controller3/Action
或(蛞蝓):
mysite.com/Area1/Folder1-Folder2/Controller1/Action
mysite.com/Area1/Folder1-Folder3/Controller3/Action
如果这种想法有效(控制器 1 命名空间),我可以使用命名空间控制器名称来创建该 slug:
namespace MyProjet.Areas.Area1.Controllers.Folder1.Folder2
我怎样才能做到这一点?也许使用类似 AttributeRouting 的东西?
谢谢