Friday, October 31, 2014

Date Comparison In Entity Framework Linq Query

Declare a DateTime variable before and compare to this one:



DateTime dt = DateTime.Now.Date;
var bookings = context.Bookings.Include("BookingItems").Where(x=>x.IsDeleted == false && DbFunctions.TruncateTime(x.BookingDate).Value == dt).ToList();





Please remember to mark helpful posts as answer and/or helpful.


No comments:

Post a Comment