I have a simple datagrid that I am trying to filter based on user. The table has 3 columns, an Id (Identity, PK), Producer (ID related to another table for a many to many relationship), and UserId (stores the text value of a username that can be chosen in a drop down on creation.
I can invoke the getProducerUsers and return all items without an issue.
If I add a filter with the query builder such as this.
I get no result like below.
Radzen is calling this OData.
dotnet: info: Microsoft.AspNetCore.Hosting.Internal.WebHost[1]
Request starting HTTP/1.1 GET http://localhost:5000/odata/Andipakt/ProducerUsers?$filter=UserId%20eq%20joshwilliam@gmail.com&$expand=Producer
If I browse to that URL I get this response.
{"error":{"code":"","message":"The query specified in the URI is not valid. Syntax error at position 31 in 'UserId eq joshwilliam@gmail.com'.","details":[],"innererror":{"message":"Syntax error at position 31 in 'UserId eq joshwilliam@gmail.com'.","type":"Microsoft.OData.ODataException","stacktrace":" at Microsoft.OData.UriParser.ExpressionLexer.ValidateToken(ExpressionTokenKind t)\r\n at Microsoft.OData.UriParser.UriQueryExpressionParser.ParseExpressionText(String expressionText)\r\n at Microsoft.OData.UriParser.ODataQueryOptionParser.ParseFilterImplementation(String filter, ODataUriParserConfiguration configuration, ODataPathInfo odataPathInfo)\r\n at Microsoft.OData.UriParser.ODataQueryOptionParser.ParseFilter()\r\n at Microsoft.AspNet.OData.Query.FilterQueryOption.get_FilterClause()\r\n at Microsoft.AspNet.OData.Query.Validators.FilterQueryValidator.Validate(FilterQueryOption filterQueryOption, ODataValidationSettings settings)\r\n at Microsoft.AspNet.OData.Query.Validators.ODataQueryValidator.Validate(ODataQueryOptions options, ODataValidationSettings validationSettings)\r\n at Microsoft.AspNet.OData.EnableQueryAttribute.ValidateQuery(HttpRequest request, ODataQueryOptions queryOptions)\r\n at Microsoft.AspNet.OData.EnableQueryAttribute.<>c__DisplayClass1_0.b__3(ODataQueryContext queryContext)\r\n at Microsoft.AspNet.OData.EnableQueryAttribute.ExecuteQuery(Object responseValue, IQueryable singleResultCollection, IWebApiActionDescriptor actionDescriptor, Func2 modelFunction, IWebApiRequestMessage request, Func
2 createQueryOptionFunction)\r\n at Microsoft.AspNet.OData.EnableQueryAttribute.OnActionExecuted(Object responseValue, IQueryable singleResultCollection, IWebApiActionDescriptor actionDescriptor, IWebApiRequestMessage request, Func2 modelFunction, Func
2 createQueryOptionFunction, Action1 createResponseAction, Action
3 createErrorAction)"}}}
I feel like this should work given the filter I setup but am not having luck. Am I doing something wrong here?
Thanks,
Josh