Use ApplyMigrations extension method
This commit is contained in:
parent
28d2d2e5d7
commit
791ec1a016
|
|
@ -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();
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue