I want to allow users of an API to send GET request that will run multiple queries on db and then return the result.
I have a query model like this
public class QueryModel
{
public int A {get;set;}
public int B {get;set;}
public int C {get;set;}
}
I have a controller with a Get method like this -
public async Task<IActionResult> Get(List<QueryModel> queryModels)
{
foreach(var queryModel in queryModels)
{
// some logic to search the db
}
// combine the results and return
}
This is not working for me, but I don't know if my query string is wrong or the method is wrong.
I have tried a number of variations of
?model={[{1,2,3},{1,2,3}]}
But they do not work.