0

嗨,我是 SQL 和 LINQ 的新手,我需要将此 sql 语句转换为 LINQ

select r.*, 
(Select name From org_table where org_ID= r.org_ID )org
(Select name From Depart_table where Depart_ID= r.Depart_ID)depart
from reserve_table r 
where name like '
4

1 回答 1

0

试试这种方式:

var result = from r in reserve_table
             where r.name.Contains("something")
             select new {
                          org = (from o in org_table where o.Org_ID = r.Org_ID select o.name)
                          depart = (from d in Depart_table where d.Depart_ID = r.Depart_ID select d.name)
                          // add the rest
                        }
于 2013-09-26T07:13:24.453 回答