[英]How to write SQL date format Like query into LINQ Or Entity Framework
I am using Entity frame work, i want to convert SQL query of LIKE date to Entity framework. 我正在使用实体框架工作,我想将LIKE日期的SQL查询转换为实体框架。 here is the query
这是查询
Select * from Schedule where SerialNo='11119' and DueDate like '%2012%'
尝试这个:
dbcontext.Schedules.Where(s => s.SerialNo == '11119' && s.DueDate.Year == 2012)
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.