zzzprojects / System.Linq.Dynamic.Core

The .NET Standard / .NET Core version from the System Linq Dynamic functionality.
https://dynamic-linq.net/
Apache License 2.0
1.57k stars 228 forks source link

System.Linq.Dynamic.Core.Exceptions.ParseException: 'Enum type '..' not found' #747

Open buraksv opened 1 year ago

buraksv commented 1 year ago

I have a code block as shown below:

string name = "ball";
byte languageId = 1;
var q = QueryRepository.Query.WhereTranslate(languageId, y => y.ProductName == name);

I'm transforming the expression I sent within the WhereTranslate method with the following code block:

var linqQuery = predicate.ToString().Replace("ProductName", "Value"); When I try to convert this transformed code block back into a LINQ query in a retransformed manner, I encounter the following error:

System.Linq.Dynamic.Core.Exceptions.ParseException: 'Enum type '..' not found'.

There is no issue when I manually write the LINQ expression, but the problem arises when I try to re-parse the "name" value that has been passed into the query parametrically. How can I overcome this issue?

StefH commented 1 year ago

@buraksv Please provide a full working :

StefH commented 11 months ago

@buraksv Can you please provide a full working example or .net fiddle or console-app?

StefH commented 9 months ago

@buraksv Can you please provide a full working example or .net fiddle or console-app?

StefH commented 8 months ago

@buraksv Can you please provide a full working example or .net fiddle or console-app?

StefH commented 2 months ago

@buraksv Can you please provide a full working example or .net fiddle or console-app?