ASP.NET CORE 6.0计数
干草 我正在研究我在C#和ASP.NET Core 6.0考试的项目中,老师希望我数数参加比赛的每个注册。
(几乎没有更多信息;它的巡回训练网站和数据库都有2个桌子。锦标赛和注册。因此,他们希望我数量与桌子中的每个注册一起注册与同一toramentallentiD的注册。))
我不知道该怎么做,好吧,我知道我需要使用计数方法。
我的TOUGHTS:
计数列表_context.tournament.tournamentId == _context.Signups.touramentiond
我不知道如何将其放入代码中。有人可以帮我吗?
**编辑1:
顺便说一句,这是我尝试过的代码,但它不起作用。
var count = _context.Signups.Count(t => t.TournamentId == id);
ViewBag.CountingSingups = count;
Hay
Im working on a project for my exam in C# and ASP.NET Core 6.0 , the teachers want me to count every sign up on a tournament.
(little more information; Its a tournement website and the database has 2 tables for this. Tournament and Sign Ups. So they want me to count every sign up in the table Sign Ups with the same TournamentID.)
I dont know how to do this, well i know that i need to use a Count method.
My toughts:
Count list where _context.Tournament.TournamentID == _context.SignUps.TournamentID
I dont know how to put this in a code. Can someone help me?
**Edit 1:
Btw, this is a code i tried, but it dont work.
var count = _context.Signups.Count(t => t.TournamentId == id);
ViewBag.CountingSingups = count;
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
通过遵循此条件,您将分别获得每个比赛的注册计数。
By following this condition you will get count of Signups for each tournament individually.