I'm trying to pass a complex object though the query string but for some reason its not working. I have a complex object that looks like this:
public class QueryOptions
{
public QueryParameter[] Parameters = new QueryParameter[0];
}
And I've tried to sent it a few ways but nothing is working:
My webapi method looks like this:
[HttpGet]
[AllowAnonymous]
public async Task<TDTO[]> GetList([FromQuery] QueryOptions queryOptions)
{
return await this._service.GetList(queryOptions);
}
I've tried with and with out the FromQuery Attribute neither are working. The url queries looks like this :
/api/users?Parameters[0].PropertyName=FirstName&Parameters[0].Value=GTitzy&Parameters[0].FilterCondition=0
I've also tried with the name of the object appened to the beginning. The request gets sent but the queryOptions always have no parameters.
How can I pass this complex object through the query string?