Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add support to Max and Min functions #404

Closed
DelvisR opened this issue Aug 6, 2020 · 4 comments
Closed

Add support to Max and Min functions #404

DelvisR opened this issue Aug 6, 2020 · 4 comments
Assignees

Comments

@DelvisR
Copy link

DelvisR commented Aug 6, 2020

How to implement Max and Min aggregate functions:

public static object Max(this IQueryable source, string selector, params object[] values)

public static object Min(this IQueryable source, string selector, params object[] values)

@JonathanMagnan JonathanMagnan self-assigned this Aug 6, 2020
@JonathanMagnan
Copy link
Member

Hello @DelvisR ,

If we try to support it, it will be without the params object[] values parameter.

Will it still be good for you?

Best Regards,

Jon


Performance Libraries
context.BulkInsert(list, options => options.BatchSize = 1000);
Entity Framework ExtensionsEntity Framework ClassicBulk OperationsDapper Plus

Runtime Evaluation
Eval.Execute("x + y", new {x = 1, y = 2}); // return 3
C# Eval FunctionSQL Eval Function

@JonathanMagnan
Copy link
Member

Hello @DelvisR ,

As expected Min and Max are already supported: https://dotnetfiddle.net/mvH6yJ

One problem by adding your overload to IQueryable, is that some ORM such as Entity Framework will not be compatible with it. So it might be better to stick with the overload that IQueryable provide to avoid some future confusion.

@DelvisR
Copy link
Author

DelvisR commented Aug 7, 2020

Even without parameters it would be very helpful.

Thank you,

@DelvisR
Copy link
Author

DelvisR commented Aug 7, 2020

Hello @DelvisR ,

As expected Min and Max are already supported: https://dotnetfiddle.net/mvH6yJ

One problem by adding your overload to IQueryable, is that some ORM such as Entity Framework will not be compatible with it. So it might be better to stick with the overload that IQueryable provide to avoid some future confusion.

Thank you very much!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

No branches or pull requests

2 participants