id | IsEnquiry |
=================
1 true
2 false
3 false
4 true
如何使用 Linq 查询获取 id(其中 IsQuery=true) 的 id 计数
请帮我写查询。
谢谢巴拉特
int count = (from row in db.Table
where row.IsEnquiry == true
select row).Count();
试试这个
var count = db.Table.Where(x=>x.IsEnquiry).Count()
试试这段代码:
int count = (from tableObj in TableName
where tableObj
.Website == "http://mywebsite.com"
select tableObj
.Website).Count()
试试这个:
int count = (from row in db.Table
where row.IsEnquiry == true
select row.id).Count();