找到最好的顶级Shoper [英] Found Best Top Shoper

查看:110
本文介绍了找到最好的顶级Shoper的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一些客户显示在表格中

购物数量最多的人用这种方式我找到了他们

I have Some customers Are shown in Table
Those who had the most number of shopping With this way I Found Them

return View(order.OrderByDescending(top=> top.UserID.Count()).Take(10));







现在我想找到任何已购买的人用最高金额赞




Now I Wanna Found Anyone who has purchased With the maximum amount Like

order.Sum(top=> top.Amount).Take(10)





如果你有想法帮我谢谢伙计



If U have Idea Help Me Thank Guys

推荐答案

您需要两个步骤。您需要选择Max以获得最大金额。然后您可以根据该值进行选择。你可以做订单。其中(top => top.Amount == top.Amount.Max())但我对此表示怀疑。
You need two steps. You need to select Max to get the maximum amount. Then you can select based on that value. You might be able to do order.Where(top => top.Amount == top.Amount.Max()) but I doubt it.


这篇关于找到最好的顶级Shoper的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆