【发布时间】:2017-10-23 11:15:47
【问题描述】:
这是我的前缀属性
[RoutePrefix("news/farms")]
public class farmsController : ApiController
我想删除基于 farmid 的行,但我想要这样的 url 结构
/news/farms/{farmId}?version={Version}
我尝试了如下代码的路由 url
[HttpDelete, Route("{farmId}?version={Version}", Name = "Deletefarm")]
但它显示
The route template cannot start with a '/' or '~' character and it cannot contain a '?' character.
请任何人告诉我是否有其他方法可以解决此错误?
【问题讨论】:
标签: c# asp.net-web-api asp.net-web-api-routing