I need to pass a List of complex objects to a GET-Request that i can filter the results.
The complex object looks like that:
public class RecordFilter
{
public int PageNumber {get;set;}
public int MaxRecordsPerPage {get;set;}
public List<FilterElement> FilterElements {get;set;}
}
public FilterElement
{
public string Name {get;set;}
public object Value {get;set;}
public bool IgnoreCase {get;set;}
}
Now I want to pass this as parameters in a GET-Request like this:
api/test/records?PageNumber=1&MaxRecordsPerPage=10&FilterElements=%7B%22Name%22%3A%22test%22%2C%20%22Value%22%3A%22x%22%2C%20%22IgnoreCase%22%3A%20true%7D
decoded its like this:
api/test/records?PageNumber=1&MaxRecordsPerPage=10&FilterElements={"Name":"test", "Value":"x", "IgnoreCase": true}
It will add an element in the "FilterElements"-List but this element has only the default-Values from the constructor (I'm using the [FromURI])...
How can I pass a List of my objects to the Webservice?