When using QueryableExtension.ToFilterString with a IEnumerable and a nullable target property value, a System.InvalidOperationException is thrown.
Demo:
Code:
protected async Task BuildFilter()
{
var filters = new List<CompositeFilterDescriptor>
{
new CompositeFilterDescriptor
{
Property = "DemoValue",
FilterOperator = FilterOperator.Contains,
LogicalFilterOperator = LogicalFilterOperator.And,
FilterValue = new long[] { 1, 2 }
}
};
try
{
filterString = Radzen.QueryableExtension.ToFilterString<Demo>(filters, LogicalFilterOperator.And, FilterCaseSensitivity.CaseInsensitive);
}
catch (Exception ex)
{
filterString = ex.ToString();
}
StateHasChanged();
}
public class Demo
{
public string Title { get; set; }
public long? DemoValue { get; set; }
}
Exception:
No generic method 'Contains' on type 'System.Linq.Enumerable' is compatible with the supplied type arguments and arguments. No type arguments should be provided if the method is non-generic.