将sql查询转换为实体框架

时间:2012-06-17 15:47:38

标签: c# .net sql-server-2008 entity-framework

我需要有人帮助转换此查询实体(c#)表单。

select * 
from incident 
where Details like'%Help%' 
and status = 'Resolved' 
or details like '%Help%' and Status = 'Closed'

看看我尝试了什么

incident = incident.Where(s => s.Details.ToUpper().Contains(SearchParam.ToUpper()));

1 个答案:

答案 0 :(得分:1)

incident = incident.Where(s => s.Details.ToUpper().Contains(SearchParam.ToUpper()) 
              && (s.Status == "Resolved" || s.Status == "Closed"));