DefaultInlineConstraintResolver Error in WebAPI 2

后端 未结 6 1574
春和景丽
春和景丽 2020-12-23 13:10

I\'m using Web API 2 and I\'m getting the following error when I send a POST to my API method using IIS 7.5 on my local box.

The inline constraint resolver o         


        
6条回答
  •  执念已碎
    2020-12-23 13:24

    You get strings as a type in the following manner

    [HttpGet]
    [Route("users/{name}")]
    public User GetUserByName(string name) { ... }
    

    Basically you just don't specify the type

提交回复
热议问题