【发布时间】:2014-08-21 11:24:40
【问题描述】:
我有一些方法 GET 的控制器:
public class TestController : ApiController
{
public List<T> Get(){...}
[ActionName("GetById")]
public T Get(int id){...}
}
即使我有不同的 ActionName,我能否以 /Get?id=1 访问第二个 Get 方法?
ActionName 用于生成不同名称的缓存
【问题讨论】:
-
你为什么不试试看呢?
-
@RoyDictus,我尝试过但没有成功,所以我认为 WebApiConfig 中的一些更改可能会有所帮助
标签: c# asp.net-mvc action