DynamicQueryable icon indicating copy to clipboard operation
DynamicQueryable copied to clipboard

Invalid Group expression usage

Open dcomartin opened this issue 5 years ago • 2 comments

DynamicQueryable version

2.0.25

Steps to reproduce

https://gist.github.com/dcomartin/3e6fff415f6886c1b3c3b50b377fa0fc

Expected behavior

Should behave and return the same results as the linq statement.

Actual behavior

Throws a System.Exception: Invalid Group expression usage. This is from the Jokenizer which this package depends on.

dcomartin avatar Feb 06 '20 16:02 dcomartin

Fixed with Jokenizer.Net 1.1.1 version.

Published new Nuget (2.0.25).

umutozel avatar Feb 10 '20 12:02 umutozel

I think I'm still seeing this problem on 2.0.25. Might be something different but it's the same error. This is what I've got:

var where = "(FirstName.ToLower().Contains(@0) || FirstName.ToLower().Contains(@1)) && (LastName.ToLower().Contains(@0) || LastName.ToLower().Contains(@1))"
var searchTerms = new List<string> { "ron", "edwards" };
query = query.Where(where, searchTerms);

If I remove the parentheses around the ORs it works but then it doesn't filter correctly

gbreen12 avatar Jan 17 '22 18:01 gbreen12