System.Linq.Dynamic.Core icon indicating copy to clipboard operation
System.Linq.Dynamic.Core copied to clipboard

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

Open buraksv opened this issue 2 years ago • 5 comments

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?

buraksv avatar Oct 02 '23 11:10 buraksv

@buraksv Please provide a full working :

  • https://dotnetfiddle.net/ OR
  • dotnet console app

StefH avatar Oct 29 '23 08:10 StefH

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

StefH avatar Dec 05 '23 17:12 StefH

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

StefH avatar Jan 23 '24 12:01 StefH

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

StefH avatar Mar 03 '24 12:03 StefH

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

StefH avatar Aug 24 '24 07:08 StefH