Category Archives: Database Initializers

Database initializer and Migrations Seed methods

Entity Framework contains two different methods both called Seed that do similar things but behave slightly differently. The first was introduced in EF 4.1 and works with database initializers. The second was introduced in EF 4.3 as part of Code … Continue reading

Posted in Code First, Code First Migrations, Database Initializers, DbContext API, Entity Framework | Tagged , , , , , , , , | 6 Comments

Code First: Inside DbContext Initialization

A lot of stuff happens when you use a DbContext instance for the first time. Most of the time you don’t worry about this stuff, but sometimes it’s useful to know what’s happening under the hood. And even if it’s … Continue reading

Posted in Code First, Database Initializers, DbContext API, Entity Framework | Tagged , , | 26 Comments

Configuring Database Initializers in a config file

Entity Framework 4.1 introduced the concept of database initializers as a way for your application or tests to perform some actions before your database is used for the first time. On the team blog and in demos we commonly show … Continue reading

Posted in Code First, Database Initializers, DbContext API, Entity Framework | Tagged , , , | 5 Comments