WebLog Posts in Category Entity Framework

Gotcha: Entity Framework gets slow in long Iteration Loops
December 21, 2014 @ 4:55am

I've been running into a common issue with Entity Framework where using a dbContext through many context operations can drastically slow down Entity Framework performance. Here's a quick overview of the problem and how to work around it with a few minor tweaks.

Entity Framework and slow bulk INSERTs
December 22, 2013 @ 10:30am

While inserting a large number of records into a SQL database using EF Code First, I ran into some stunningly slow performance. In this article I show the problem and a couple of simple workarounds to this issue.

Firing an Entity Framework Database Initializer from within DbContext
March 26, 2013 @ 12:53pm

Database initializers in Entity Framework can be a pain, especially when you're using EF as part of smaller components that may or may not load into a database shared with other EF Contexts. Here's a small helper utility that lets you internalize the database initializer and fire it the first time the context is loaded.

Sql Connection Strings in .Config Files vs. Source Control
February 27, 2013 @ 12:18pm

Connection strings in projects under source control can be problematic. Each Source Control user can potentially have different connection settings to use a database connection and these differences can't be easily reconciled via Source Control. Here are a couple of approaches that have worked for me to deal with this issue.

Basic Spatial Data with SQL Server and Entity Framework 5.0
June 21, 2012 @ 7:10am

Spatial data has been available for a while in SQL Server, but if you wanted to use it with Entiry Framework you had to jump through some hoops. In this post I show how basic SQL Spatial data works and then how you can utilize the new features in EF 5.0 to directly access spatial data using your CodeFirst models.