Closed vzsoft closed 1 year ago
Hello @vzsoft ,
Thank you for reporting.
We will look at this. We support the operator ?.
but it looks like this causes us an error when using with the Min
/ Max
method.
I believe our library doesn't know which method to take between this 2:
public static int? Max<TSource>(this IEnumerable<TSource> source, Func<TSource, int?> selector);
public static int Max<TSource>(this IEnumerable<TSource> source, Func<TSource, int> selector);
We will look at it.
Best Regards,
Jon
Hi @JonathanMagnan ,
Sum
method is like the Max
method, but it work
var testSum = Eval.Execute("{0}.Where(x => x.Age== 20).Sum(x => x?.Age)", lst ); //work
public static int? Sum<TSource>(this IEnumerable<TSource> source, Func<TSource, int?> selector);
public static int Sum<TSource>(this IEnumerable<TSource> source, Func<TSource, int> selector);
Thank you
Hello @vzsoft ,
Just to let you know that this issue has been fixed. It will be released the next time we release this library (in 1 or 2 weeks).
The method conflict was actually caused by another Max
method with more generic parameters. So that explains why the Sum
didn't have the issue as it didn't have the other method.
Best Regards,
Jon
Thank you so much
Hello @vzsoft ,
The fix has finally been released in v5.0.8
Our method resolution logic has been improved with this issue by taking into account the number of generic parameters of a method when trying to find the BetterMember
methods.
Let us know if everything works as expected.
Best Regards,
Jon
Nice Work, Thank you so much
Hi,
I got Error in Max Min
my class:
my code:
Thank you