The below Url's requests work and return data.
The below Url requests do not work and return an exception. This is Greater than or Equal to, Less that or Equal To and Not Equal to
I am using a kendo grid with server filtering turned on and the grid calls a data source which is a web API controller that accepts a custom Model binder (by implementing IModelBinder) and on that model binder, it does the below which fails.
http://localhost:63455/api/data/gethistory?$top=5&$filter=(Id+eq+1+and+PaymentId+eq+11)
http://localhost:63455/api/data/gethistory?$top=5&$filter=(Id+eq+1+and+PaymentId+gt+11)
http://localhost:63455/api/data/gethistory?$top=5&$filter=(Id+eq+1+and+PaymentId+lt+11)
The below Url requests do not work and return an exception. This is Greater than or Equal to, Less that or Equal To and Not Equal to
http://localhost:63455/api/data/gethistory?$top=5&$filter=(Id+eq+1+and+PaymentId+ge+11)
http://localhost:63455/api/data/gethistory?$top=5&$filter=(Id+eq+1+and+PaymentId+le+11)
http://localhost:63455/api/data/gethistory?$top=5&$filter=(Id+eq+1+and+PaymentId+ne+11)
I am using a kendo grid with server filtering turned on and the grid calls a data source which is a web API controller that accepts a custom Model binder (by implementing IModelBinder) and on that model binder, it does the below which fails.
var filter =
"(TransportProviderId eq 1 and PaymentRequestId ge 5)"
request.Filters = FilterDescriptorFactory.Create(
string
.Join(
"~"
, filter.Split(
' '
)));
{"Message":"An error has occurred.","ExceptionMessage":"Expected RightParenthesis","ExceptionType":"Kendo.Mvc.Infrastructure.Implementation.FilterParserException","StackTrace":" at Kendo.Mvc.Infrastructure.Implementation.FilterParser.Expect(FilterTokenType tokenType)\r\n at Kendo.Mvc.Infrastructure.Implementation.FilterParser.ParseNestedExpression()\r\n at Kendo.Mvc.Infrastructure.Implementation.FilterParser.PrimaryExpression()\r\n at Kendo.Mvc.Infrastructure.Implementation.FilterParser.ComparisonExpression()\r\n at Kendo.Mvc.Infrastructure.Implementation.FilterParser.AndExpression()\r\n at Kendo.Mvc.Infrastructure.Implementation.FilterParser.OrExpression()\r\n at Kendo.Mvc.Infrastructure.Implementation.FilterParser.Expression()\r\n at Kendo.Mvc.Infrastructure.Implementation.FilterParser.Parse()\r\n<
br
>at Kendo.Mvc.Infrastructure.FilterDescriptorFactory.Create(String input)\r\n at RequestModelBinder.BindModel(HttpActionContext actionContext, ModelBindingContext bindingContext)