comminity-data-odata-linq icon indicating copy to clipboard operation
comminity-data-odata-linq copied to clipboard

Filter does not support in expression

Open kanusiewicz opened this issue 6 years ago • 5 comments

sample filter: Param in (0,100)

throws exception:

"ExceptionType": "System.NotImplementedException", "StackTrace": " w Microsoft.OData.UriParser.QueryNodeVisitor1.Visit(InNode nodeIn)\r\n w Microsoft.OData.UriParser.InNode.Accept[T](QueryNodeVisitor1 visitor)\r\n w Community.OData.Linq.OData.Query.ParameterAliasNodeTranslator.Visit(ConvertNode nodeIn)\r\n w Microsoft.OData.UriParser.ConvertNode.Accept[T](QueryNodeVisitor1 visitor)\r\n w Community.OData.Linq.OData.Query.ParameterAliasNodeTranslator.Visit(BinaryOperatorNode nodeIn)\r\n w Microsoft.OData.UriParser.BinaryOperatorNode.Accept[T](QueryNodeVisitor1 visitor)\r\n w Community.OData.Linq.OData.Query.ParameterAliasNodeTranslator.Visit(BinaryOperatorNode nodeIn)\r\n w Microsoft.OData.UriParser.BinaryOperatorNode.Accept[T](QueryNodeVisitor1 visitor)\r\n w Community.OData.Linq.OData.Query.ParameterAliasNodeTranslator.Visit(BinaryOperatorNode nodeIn)\r\n w Microsoft.OData.UriParser.BinaryOperatorNode.Accept[T](QueryNodeVisitor1 visitor)\r\n w Community.OData.Linq.ODataLinqExtensions.Filter[T](ODataQuery`1 query, String filterText, String entitySetName)\r\n w AbcData.Services.News.DataModel.NewsODataService.GetNews(String filter) w

kanusiewicz avatar Jan 30 '19 13:01 kanusiewicz

"In" logical operator is part of OData 4.01 (http://docs.oasis-open.org/odata/odata/v4.01/csprd02/part2-url-conventions/odata-v4.01-csprd02-part2-url-conventions.html).

Current project support only OData 4.0. It should throw ODataException with message about "Syntax error".

It looks like you using Microsoft.OData.Core of latest version which already can work with "In", so you got another exception.

IharYakimush avatar Jan 31 '19 11:01 IharYakimush

Hi, so is there any workaround for that? I suppose that we can only rewrite de query in a multiple ORs way. Do you plan to add it as a support?

rtellez91 avatar Oct 11 '22 19:10 rtellez91

same issue here, is there a workaround. really need to use the in operator.

GuusDb avatar Apr 05 '23 11:04 GuusDb

This problem also occurred when I used the in operator. Is there any solution?

System.Reflection.TargetInvocationException: Exception has been thrown by the target of an invocation. ---> System.NotImplementedException: The method or operation is not implemented. at Microsoft.OData.UriParser.QueryNodeVisitor1.Visit(InNode nodeIn) at Microsoft.OData.UriParser.InNode.Accept[T](QueryNodeVisitor1 visitor)

mosqic33 avatar Jul 26 '24 03:07 mosqic33