更新时间:2022-06-27 00:20:11
查询语法:
var count = (from o in context.MyContainer
where o.ID == '1'
from t in o.MyTable
select t).Count();
方法语法:
var count = context.MyContainer
.Where(o => o.ID == '1')
.SelectMany(o => o.MyTable)
.Count()
两者都生成相同的 SQL 查询.
Both generate the same SQL query.