The specified type member ‘Date’ is not supported in LINQ to Entities Exception

You can use the TruncateTime method of the EntityFunctions to achieve a correct translations of the Date property into SQL: using System.Data.Objects; // you need this namespace for EntityFunctions // … DateTime ruleData = Convert.ToDateTime(rule.data).Date; return jobdescriptions .Where(j => EntityFunctions.TruncateTime(j.JobDeadline) == ruleData); Update: EntityFunctionsis deprecated in EF6, Use DbFunctions.TruncateTime

Batch update/delete EF5

There are two open source projects allowing this: EntityFramework.Extended and Entity Framework Extensions. You can also check discussion about bulk updates on EF’s codeplex site. Inserting 100k records through EF is in the first place wrong application architecture. You should choose different lightweight technology for data imports. Even EF’s internal operation with such big record … Read more

Disable lazy loading by default in Entity Framework 4

The following answer refers to Database-First or Model-First workflow (the only two workflows that were available with Entity Framework (version <= 4.0) when the question was asked). If you are using Code-First workflow (which is available since EF version >= 4.1) proceed to ssmith’s answer to this question for a correct solution. The edmx file … Read more

How to mock the limitations of EntityFramework’s implementation of IQueryable

I think it is very very hard, if impossible, to mock Entity Framework behaviour. First and foremost because it would require profound knowledge of all peculiarities and edge cases where linq-to-entites differs from linq-to-objects. As you say: the real challenge is finding them. Let me point out three main areas without claiming to be even … Read more

Improving bulk insert performance in Entity framework [duplicate]

There is opportunity for several improvements (if you are using DbContext): Set: yourContext.Configuration.AutoDetectChangesEnabled = false; yourContext.Configuration.ValidateOnSaveEnabled = false; Do SaveChanges() in packages of 100 inserts… or you can try with packages of 1000 items and see the changes in performance. Since during all this inserts, the context is the same and it is getting bigger, … Read more