【发布时间】:2022-01-20 12:50:39
【问题描述】:
嗨,我写了这个 sql 查询,但我想写 linq 版本 sql版本
Select CalisanId From Calisanlar Where Lisans=0 INTERSECT (Select CalisanId From Covids)
public List<LisansCovid> GetLisansCovid()
{
using (SirketDBContext context = new SirketDBContext())
{
var result =
(from cal1 in context.Calisanlar
where cal1.Lisans == 0
select cal1.CalisanId)
.Intersect
(from cal2 in context.Covids
select cal2.CalisanId);
//exception return result.ToList();
}}
【问题讨论】:
-
这能回答你的问题吗? Linq to SQL and Intersect
-
没有。对不起:(
-
为什么不呢?是等价的函数。
-
到目前为止你做了什么?你能给我们看看吗?
-
我不是代码编写工厂。 Stack Overflow 可帮助诊断和解决问题;帮助学习。
标签: mysql sql linq tsql linq-to-sql