I have five strong-typed List objects. Every object inside every List have property Rating and Vote.
How can I select only 10 top rated object from all List‘s objects? if Rating equal then need use Vote
Example(select 2 top rated):
List<Film>:
0 element: rating = 1, vote = 2; 1 element: rating = 4, vote = 5;
List<Clubs>:
0 element: rating = 5, vote = 3; 1 element: rating = 4, vote = 3;
Result: 0 element from Clubs and 1 element from Film
If there is no common sub-class among these element types, you can use LINQ to project the lists using a generic
Tuple<int, int, object>(i.e. rating, vote, and the original element instance) containing the two properties you are interested in. Then you can do a simple query to pick the top 10 elements: