Monday, December 10, 2012

Date range query in Entity framework

Entity Framework Date rang query is not same as like LINQ.
You can try like this

 var events = this.coreDomainContext.Events.Where(  
   e => EntityFunctions.TruncateTime(e.EventDate.Value) >= DateTime.Today  
    && EntityFunctions.TruncateTime(e.EventDate.Value) <= EntityFunctions.TruncateTime(endPeriod))  
   .OrderByDescending(e => e.EventDate)  

For details you can See

SQL Get all Index create script from Database

To get all script from database as a create new index into another database you can use the following --Get all Index Script SELECT...