Reputation: 5425
I'm working on a project which there are shop's and customer's.customer's can score shop's.
my Score Data Table is like this:
Table Name is:ShopScores
I want to retrieve top 10 shops based on their Score field result.Is it possible to do that and if the answer is Yes, How can I do it?
By the way, I want to do that using LINQ Query.
Upvotes: 0
Views: 47
Reputation:
SELECT * FROM `ShopScores` ORDER BY `score` DESC LIMIT 10
this gives the records ordered by score ,but this is for mysql This works perfectly fine
Upvotes: 0
Reputation: 35790
With linq
:
var result = Context.ShopScores.OrderByDescending(c=>c.Score).Take(10);
Upvotes: 3