Closed vzsoft closed 4 years ago
Hello @vzsoft ,
The issue is caused by this part: field = Name
That's not valid, the name comes from nowhere.
That's probably not what you want but here is an example that works:
Eval.Execute("({0}).GroupBy(x => x.Name, (x0, y0) => new { value = x0, field = y0.Max(z => z.Name), aggregates = new { sum = y0.Sum(g => g?.Age), max = y0.Max(g => g?.Age) } }).ToList()", lst);
You probably want the name of the field in the group by, here is another example:
ar item = Eval.Execute("({0}).GroupBy(x => x.Name, (x0, y0) => new { value = x0, field = 'Name', aggregates = new { sum = y0.Sum(g => g?.Age), max = y0.Max(g => g?.Age) } }).ToList()", lst);
Let me know if that helps you to get your expressions solved.
Best Regards,
Jon
Hi,
I got Error in Eval.Execute
https://dotnetfiddle.net/T1id3Q
thank you so much
my class:
my code: