WebApi与MVC Route 问题整理

1. 为WebAPI添加 Area后,完成了CustomControllerSelector的制定。

跟踪WebAPI底层,整理WebAPI源码后发现几个问题:

1. 使用Area的controller 必须走CustomSelector的。建议。不然小问题特别多

2. 不要使用默认的Selector,最好也别用Route。

4. 用Route,必须走默认的Selector。Route 中不能与 默认Selector中路由control相同

5. 默认Selector 只认不重复的Controller 这是死理

2. MVC部分

Route注册的优先级:先AreaRoute -》 默认Route 

ModelBinder: ModelBinderDictionary.GetBinder  -》  ModelBinderProviderCollection

有时间后记

原文地址:https://www.cnblogs.com/shikyoh/p/7241452.html