Closed toliverg closed 2 years ago
Hello @toliverg ,
Thank you for the project,
My developer will look at it and try to fix it.
Best Regards,
Jon
Hello @toliverg ,
The v4.0;82 has been released.
Let me know if everything is now working correctly with enum.
Best Regards,
Jon
Hi,
Yes, it's working fine now. Thanks a lot for the fast fix.
Best Regards,
Tolo
Hi,
I'm getting this issue in version 5.0.9.0 when trying to run something like this:
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
It seems like using an enum in the WhereDynamic doesn't work. Or maybe I'm missing something.
Kind Regards Fredrik Dahlberg
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?
Best Regards,
Jon
Hi,
I encountered a problem trying to filter a dynamic linq expression using a flag-enum and a bit-and.
I can execute something like .WhereDynamic("x => x.CustomerType == CustomerType.A") but when I try to filter for something like: .WhereDynamic("x => (x.CustomerType & CustomerType.A) == CustomerType.A") I'm getting Z.Expressions.Compiler.Shared.EvalException: 'Oops! No applicable member has been found for the expression. The error occurred for expression "." at position 3 near ".Where(x => (x.CustomerTy".'
One workaround is WhereDynamic("x => ((int)x.CustomerType & (int)CustomerType.A) == (int)CustomerType.A"). I'm not sure if this fix is universal, specially when working with EF Core and things like that.
I have included a small solution to show you the problem.
Best regards, Tolo TestFlags.zip