I have my action in Controller:
[HttpPost]
public JsonResult SignUp(DTOUser dtoUser)
{
return Json(new string[] { "value1", "value2" } );
}
and I have my formatters configured in Startup.cs
services.AddMvcCore(options => {
options.InputFormatters.Insert(0, new JilInputFormatter());
options.OutputFormatters.Insert(0, new JilOutputFormatter());
});
The problem here is my dtoUser has all variables null until I specify [FromBody]
Why do I have to specify FromBody everytime. This was never required in Asp.Net 4 older version.
How can I get around this issue. It's just an added overhead of adding FromBody to 100s of actions in my project that I will be developing. Any global place where I can add this thing to keep it happy?
Thanks!