使用Count()的查询 [英] A query that uses a Count()
本文介绍了使用Count()的查询的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我在下面有这样的询问:
var q = 来自行 DataAccess.metadata.db_Employee
其中 row.QuestionsSubmitted == true
选择 new bl_AdminDashboard
{
monthX = row.employeeID,
};
我需要能够计算这些ID的数量,但我没有Count()
解决方案
希望你期待..
int count =(来自行 DataAccess.metadata.db_Employee
其中 row.QuestionsSubmitted == true
选择 new bl_AdminDashboard
{
monthX = row.employeeID,
})。ToList< bl_AdminDashboard> ().Count之间();
I have this query below:
var q = from row in DataAccess.metadata.db_Employee
where row.QuestionsSubmitted == true
select new bl_AdminDashboard
{
monthX = row.employeeID,
};
I need to be able to count number of these ID's but I dont have the Count()
解决方案
hope you are expecting..
int count = (from row in DataAccess.metadata.db_Employee where row.QuestionsSubmitted == true select new bl_AdminDashboard { monthX = row.employeeID, }).ToList<bl_AdminDashboard>().Count();
这篇关于使用Count()的查询的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文