这句sql这样转成LINQ 语句


这句sql这么转成LINQ 语句?
select  *  from mcodetype t where t.[typecode] like '%%'and t.[typename] like '%%'

and exists (

select distinct type_code from m_code c where c.code_name like '%%' and c.type_code=t.type_code<br />

)

.net 程序开发 linq

.发条橙. 14 years, 5 months ago

  //毛主席说,没有结帖习惯的程序员不是好厨师
var query=from t in m_code_type
          let temp=m_code.Where(c=>c.code_name.Contains("") && c.type_code ==t.type_code)
                         .Select(c=>c.type_code).Distinct()
          where t.type_code.Contains("") && t.type_name.Contains("")
          && temp.Any()
          select t;

bbb1368 answered 14 years, 5 months ago

Your Answer