I am not getting any errors in my code, but my filter object is always null. When I run the debugger the filter object looks just like the sort object, a list with stuff in it.
The list is null because you are trying to cast List
into List
, but just because FilterDescriptor
inherits from IFilterDescriptor
doesn't mean that List
inherits from List
(unless the list is covariant List
which it isn't).
You should do it like this:
IList filter = request.Filters;
if the interface is fine with that, otherwise you can case the list like that:
List filter = request.Filters.OfType.ToList();