Tag Archives: EF7

[ASP.NET Core 1.0] Automatic Migrations in Entity Framework 7 (EF Core 1.0)

Advertisement from Google There is no more public Configuration() { AutomaticMigrationsEnabled = false; } in Entity Framework Core 1.0 (formerly  EF 7.0) Now you can use extension Migrate method during database initialization. Advertisement from Google For example, you have custom DBInitializer class: public class DBInitialization { public static void Initialize() { using (var context =… Read More »

[ASP.NET 5] Lazy DBContext initialization with Entity Framework 7

I will show you how to do lazy db context initialization with Entity Framework 7. The idea is simple, we need an easy way to get database context in a request. If db context was used in the request we should call SaveChanges method and dispose used context if not we shouldn’t do anything. For “client”, code… Read More »