zzzprojects / Eval-Expression.NET

C# Eval Expression | Evaluate, Compile, and Execute C# code and expression at runtime.
https://eval-expression.net/
Other
449 stars 86 forks source link

Using enum value in WhereDynmaic #148

Closed fdahlberg closed 12 months ago

fdahlberg commented 1 year ago

Hi,

I'm getting the following error: 'Oops! No applicable member has been found for the expression. The error occurred for expression "." at position 3 this happens when I try to use an enum value in wheredynamic.

var customers = context.Customers.WhereDynamic(x => "x.Status == CustomerStatus.IsActive && x.LastLogon >= DateTime.Now.AddMonths(-1)").ToList();

I just slightly modified your sample here; https://dotnetfiddle.net/b5EmTM

https://github.com/zzzprojects/Eval-Expression.NET/issues/133#issuecomment-1729235387

Kind Regards Fredrik Dahlberg

JonathanMagnan commented 1 year ago

Hello @fdahlberg ,

The current Fiddle you provided is currently working. Perhaps you modified it and saved it by mistake, or my developer is missing something?

Fiddle currently doesn't return any error.

Best Regards,

Jon

JonathanMagnan commented 1 year ago

Hello @fdahlberg,

Since our last conversation, we haven't heard from you.

As previously mentioned the current Fiddle is working.

Let me know if you need further assistance.

Best regards, Jon