Use ApplyMigrations extension method

This commit is contained in:
Arthur Vickers 2015-06-19 11:37:01 -07:00
parent 28d2d2e5d7
commit 791ec1a016
1 changed files with 2 additions and 2 deletions

View File

@ -15,6 +15,7 @@ using Microsoft.AspNet.TestHost;
using Microsoft.Data.Entity; using Microsoft.Data.Entity;
using Microsoft.Data.Entity.Infrastructure; using Microsoft.Data.Entity.Infrastructure;
using Microsoft.Data.Entity.Internal; using Microsoft.Data.Entity.Internal;
using Microsoft.Data.Entity.Relational;
using Microsoft.Data.Entity.Relational.Migrations; using Microsoft.Data.Entity.Relational.Migrations;
using Microsoft.Data.Entity.Relational.Migrations.Infrastructure; using Microsoft.Data.Entity.Relational.Migrations.Infrastructure;
using Microsoft.Data.Entity.Utilities; using Microsoft.Data.Entity.Utilities;
@ -161,8 +162,7 @@ namespace Microsoft.AspNet.Diagnostics.Entity.Tests
{ {
using (var db = context.ApplicationServices.GetService<BloggingContextWithPendingModelChanges>()) using (var db = context.ApplicationServices.GetService<BloggingContextWithPendingModelChanges>())
{ {
var migrator = ((IAccessor<IMigrator>)db.Database).Service; db.Database.ApplyMigrations();
migrator.ApplyMigrations();
db.Blogs.Add(new Blog()); db.Blogs.Add(new Blog());
db.SaveChanges(); db.SaveChanges();