codecutout/StringToExpression

Operator in OData filter parameter

Closed this issue · 2 comments

Hi,
I have a problem when i have an operator in a parameter of my filter OData.
I think one of the solutions could be to indicate that the operator must be preceded and succeeded by a white space. Is this something that I can customize from my side ?

For exemple : "order eq true"
In this case, the parser considers that I am on a "OR" filter and crashes with the following message :

StringToExpression.Exceptions.OperationInvalidException : Unable to perform operation 'der'
---- System.ArgumentNullException : Value cannot be null. (Parameter 'member')
Stack Trace:
OperandDefinition.Apply(Token token, ParseState state)
Parser.Parse(IEnumerable1 tokens, IEnumerable1 parameters)
Language.Parse(String text, ParameterExpression[] parameters)
ODataFilterLanguage.Parse[T](String text)
----- Inner Stack Trace -----
Expression.MakeMemberAccess(Expression expression, MemberInfo member)
<>c.b__11_1(Expression exp, String prop)
Enumerable.Aggregate[TSource,TAccumulate](IEnumerable1 source, TAccumulate seed, Func3 func)
<>c.b__11_0(String value, ParameterExpression[] parameters)
OperandDefinition.Apply(Token token, ParseState state)

Little raise on this subject.
Another filter problem : moduleName eq ''

StringToExpression.Exceptions.OperationInvalidException:Unabletoperformoperation'uleName'

For information, the subject is closed : #12
The fix is available in the latest version.