I am attempting to pass a complex object in a GET request. The C# model object looks like this:
public class GetRequest
{
public string ID { get; set; }
public List<string> RequestedFields { get; set; }
public Dictionary<string, List<string>> RequestedGrids { get; set; }
}
Looking at the request in Chrome I see the following under "Query String Parameters":
ID: 1
RequestedFields[]: someTxtField
RequestedFields[]: someOtherField
RequestedGrids[someGrid][]: keyColumn
RequestedGrids[someGrid][]: someDataColumn
I would expect such a request to be deserialized correctly as the parameter in the following action:
[HttpGet]
[ActionName("get")]
public Dictionary<string,object> GetStuff([FromUri] GetRequest get_req)
However, whenever a request enters this action, the RequestedGrids property of the parameter always has a count of 0, while the other properties are populated fine. Is there a way to make this work?
Addition
The object going into the JQuery $.get call looks like this:
{ ID: p_key, RequestedFields: p_page.dataIds, RequestedGrids: p_page.grids }
Where RequestedFields is a plain array of strings and RequestedGrids is a plain object where each object property value is an array of strings.