Answer the question
In order to leave comments, you need to log in
Why does [FromBody] deserialize data into properties and not fields?
For example, there is a controller accepting stringfy json
public ViewResult Insert([FromBody]InsertGroup json)
{
//Some code
}
public class InsertGroup
{
public int[] selnames { get; set; }
public string template { get; set; }
}
Answer the question
In order to leave comments, you need to log in
I suspect it has something to do with reflection. In any case, you can see the source code and create your own binding.
PS why don't you like the properties?
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question