且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

如何将查询转换为LINQ

更新时间:2023-02-14 10:25:49

只是一个假设,但尝试将其拆分



var res1 =来自中心的t1

加入t2 in j1上的t1.switchtypeid = t2.switchtypeid上的switchtype
来自j上的j的


在j1.t2.switchtypeid = t3.switchtypeid的reporttype中加入t3

其中j1.t1.centerid == 1 || j1.t1.sitchtypeid == null

选择新{reportname = t3.name

}
just an assumption, but try splitting it up

var res1 = from t1 in center
join t2 in switchtype on t1.switchtypeid = t2.switchtypeid on j1
from j on j1
join t3 in reporttype on j1.t2.switchtypeid = t3.switchtypeid
where j1.t1.centerid == 1 || j1.t1.sitchtypeid == null
select new { reportname = t3.name
}