Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Error with 'Equals' together with other parameters #799

Closed
voliveriourmobo opened this issue Apr 18, 2024 · 4 comments
Closed

Error with 'Equals' together with other parameters #799

voliveriourmobo opened this issue Apr 18, 2024 · 4 comments
Assignees
Labels

Comments

@voliveriourmobo
Copy link

voliveriourmobo commented Apr 18, 2024

Hi,

I’m having a problem using your Dynamic LINQ lib regarding multiple where clauses.

When I try to filter a list using the query Manufacturer.Equals("samsung",StringComparison.OrdinalIgnoreCase) and BatteryLevel < 20, I get the following error:

“No property or field 'BatteryLevel' exists in type 'Char'”

But If I change the order of the sentence to ‘BatteryLevel < 20 and Manufacturer.Equals("samsung",StringComparison.OrdinalIgnoreCase)’ it works just fine, is this the expected behavior?

Stack Trace:

   at System.Linq.Dynamic.Core.Parser.ExpressionParser.ParseMemberAccess(Type type, Expression expression, String id)
   at System.Linq.Dynamic.Core.Parser.ExpressionParser.ParseIdentifier()
   at System.Linq.Dynamic.Core.Parser.ExpressionParser.ParsePrimaryStart()
   at System.Linq.Dynamic.Core.Parser.ExpressionParser.ParsePrimary()
   at System.Linq.Dynamic.Core.Parser.ExpressionParser.ParseUnary()
   at System.Linq.Dynamic.Core.Parser.ExpressionParser.ParseArithmetic()
   at System.Linq.Dynamic.Core.Parser.ExpressionParser.ParseAdditive()
   at System.Linq.Dynamic.Core.Parser.ExpressionParser.ParseShiftOperator()
   at System.Linq.Dynamic.Core.Parser.ExpressionParser.ParseComparisonOperator()
   at System.Linq.Dynamic.Core.Parser.ExpressionParser.ParseLogicalAndOrOperator()
   at System.Linq.Dynamic.Core.Parser.ExpressionParser.ParseIn()
   at System.Linq.Dynamic.Core.Parser.ExpressionParser.ParseAndOperator()
   at System.Linq.Dynamic.Core.Parser.ExpressionParser.ParseOrOperator()
   at System.Linq.Dynamic.Core.Parser.ExpressionParser.ParseLambdaOperator()
   at System.Linq.Dynamic.Core.Parser.ExpressionParser.ParseNullCoalescingOperator()
   at System.Linq.Dynamic.Core.Parser.ExpressionParser.ParseConditionalOperator()
   at System.Linq.Dynamic.Core.Parser.ExpressionParser.Parse(Type resultType, Boolean createParameterCtor)
   at System.Linq.Dynamic.Core.DynamicExpressionParser.ParseLambda(Type delegateType, ParsingConfig parsingConfig, Boolean createParameterCtor, ParameterExpression[] parameters, Type resultType, String expression, Object[] values)
   at System.Linq.Dynamic.Core.DynamicExpressionParser.ParseLambda(ParsingConfig parsingConfig, Boolean createParameterCtor, ParameterExpression[] parameters, Type resultType, String expression, Object[] values)
   at System.Linq.Dynamic.Core.DynamicExpressionParser.ParseLambda(ParsingConfig parsingConfig, Boolean createParameterCtor, Type itType, Type resultType, String expression, Object[] values)
   at System.Linq.Dynamic.Core.DynamicQueryableExtensions.Count(IQueryable source, ParsingConfig config, String predicate, Object[] args)
   at System.Linq.Dynamic.Core.DynamicQueryableExtensions.Count(IQueryable source, String predicate, Object[] args)
@StefH StefH self-assigned this Apr 18, 2024
@StefH StefH added the bug label Apr 18, 2024
@StefH
Copy link
Collaborator

StefH commented Apr 18, 2024

Which version do you use?

@StefH
Copy link
Collaborator

StefH commented Apr 18, 2024

#800

@StefH
Copy link
Collaborator

StefH commented Apr 18, 2024

@voliveriourmobo
I think this bug is introduced in the latest version 1.3.11

A fix in package 1.3.12 will be released soon.

@StefH StefH closed this as completed Apr 18, 2024
@voliveriourmobo
Copy link
Author

Hi, in fact I am using the latest available version.

Great, thank you very much!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Development

No branches or pull requests

2 participants