L
L
Ledington2021-12-17 16:00:56
C++ / C#
Ledington, 2021-12-17 16:00:56

How to pass a lambda expression and call all maximums?

Can you please tell me how to pass a lambda expression as a parameter to a method and get the result?
For example:
var list = new List{...};
list.Max(15, person => person.Age) // takes T and returns an int
should return the 15% of users with the highest age in descending order.

Answer the question

In order to leave comments, you need to log in

1 answer(s)
F
freeExec, 2021-12-17
@freeExec

takes T and returns an int

Func<int, T>
should return the 15% of users with the highest age in descending order.

It's not at all clear what your question refers to.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question