How to use BETWEEN keyword in LINQ (Eentity-framework)
To search between two date ranges in your LINQ for Entity Framework, you can use >=
and <=
with DateTime
to get values between given range.
For Example:
DBEntities db = new DBEntities();
var ml = db.Orders.SingleOrDefault(p => p.OrderStatus == “Urgent”
&& p.OrderDate <= yourDate
&& p.OrderDate >= yourDate);
Hope this will help.