查询以了解日期范围之间没有特定状态的订单将返回零结果
Linq To SQL
string[] notHavingStaus = { "CantFind", "Review" };
_repository.Query<Entities.Order>()
.Where(x => (!notHavingStaus.Contains(x.ApplicationStatus))
&& x.OrderDate >= fromdate && x.OrderDate <= todate);
生成的查询
/****** Script for SelectTopNRows command from SSMS ******/
SELECT *
FROM [dbo].[Order]
Where (not ApplicationStatus in ('CantFind' , 'Review')) and
(OrderDate>='2019-07-16' and OrderDate<='2019-07-17')