I'm having an issue with my parameter not binding when I send a request to my API endpoint when passing a query string, the parameter binds if I flatten Submission but this isn't the solution I want. I can't provide the client-side code that sends the request as a third party control handles the request.
I've supplied an example of the query string sent with the request that can be seen in developer tools, however, Person and Property come back as null. Does anyone have any suggestions, specifically server-side changes that I can do to bind this complex object? thanks.
public class Submission {
public Person Person {get; set; }
public Property Property { get; set; }
}
public class Person {
public int Age { get; set; }
}
public class Property {
public string Address { get; set; }
}
Query string parameters
'Person[Age]': 18
'Property[Address]': test
[HttpGet("action")]
public async Task<IActionResult> Submit([FromQuery] Submission model)
{
}
Person.Agein the querystring.