简体   繁体   中英

convert sql query to entity framework

Please i need someone to help convert this query entity(c#) form.

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

See what I tried

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

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM