阅读背景:

如何获得ASP。NET Core 2.0 MVC模型绑定器来绑定复杂类型,而不使用body属性

来源:互联网 

So in ASP.NET Core MVC they decided that I need to type [FromBody] in front of all my action parameters of complex types because of some legendary CSRF issue nobody seems to talk about. I find this quite absurd so is there a way to make ASP.NET Core MVC behave like the old WebAPI and not require [FromBody] everywhere and just bind everything that is JSON to the complex type parameters? It will be great if I can somehow choose the set of controllers it applies to like for example controllers which start with /api or controllers which are decorated with a specific attribute.So in ASP.NET Core MVC they decided that I need




你的当前访问异常,请进行认证后继续阅读剩余内容。

分享到: