读书人

这句sql这样转成LINQ 语句

发布时间: 2012-12-26 14:39:28 作者: rapoo

这句sql这么转成LINQ 语句?
select * from m_code_type t where t.[type_code] like '%%'and t.[type_name] like '%%'
and exists (
select distinct type_code from m_code c where c.code_name like '%%' and c.type_code=t.type_code
)
[解决办法]


//毛主席说,没有结帖习惯的程序员不是好厨师
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;

读书人网 >.NET

热点推荐