Having this in my Controller
[HttpGet]
public string Get([FromQuery] QueryObject obj)
{
return "value";
}
public class QueryObject
{
public int Number { get; set; }
}
When I invoke the Get Method with this URL
http://localhost/MyController?Number=HELLO
I end up having a QueryObject instance with Number = 0
Why this ever happens? The query is clearly a BAD REQUEST, since Number is a integer and the query has a string.