React to EF changes
This commit is contained in:
parent
a54886b3f3
commit
88d977b193
|
|
@ -9,6 +9,7 @@ using Microsoft.AspNet.Http;
|
|||
using Microsoft.AspNet.RequestContainer;
|
||||
using Microsoft.Data.Entity;
|
||||
using Microsoft.Data.Entity.Infrastructure;
|
||||
using Microsoft.Data.Entity.Internal;
|
||||
using Microsoft.Data.Entity.Relational;
|
||||
using Microsoft.Data.Entity.Relational.Migrations;
|
||||
using Microsoft.Data.Entity.Relational.Migrations.Infrastructure;
|
||||
|
|
@ -86,8 +87,7 @@ namespace Microsoft.AspNet.Diagnostics.Entity
|
|||
{
|
||||
var databaseExists = dbContext.Database.AsRelational().Exists();
|
||||
|
||||
var databaseInternals = (IMigrationsEnabledDatabaseInternals)dbContext.Database;
|
||||
var migrator = databaseInternals.Migrator;
|
||||
var migrator = ((IAccessor<Migrator>)dbContext.Database).Service;
|
||||
|
||||
var pendingMigrations = migrator.GetPendingMigrations().Select(m => m.GetMigrationId());
|
||||
|
||||
|
|
|
|||
|
|
@ -53,7 +53,7 @@ namespace Microsoft.AspNet.Diagnostics.Entity
|
|||
{
|
||||
_logger.WriteVerbose(Strings.FormatMigrationsEndPointMiddleware_ApplyingMigrations(db.GetType().FullName));
|
||||
|
||||
db.Database.AsMigrationsEnabled().ApplyMigrations();
|
||||
db.Database.AsRelational().ApplyMigrations();
|
||||
|
||||
context.Response.StatusCode = (int)HttpStatusCode.NoContent;
|
||||
context.Response.Headers.Add("Pragma", new[] { "no-cache" });
|
||||
|
|
|
|||
Loading…
Reference in New Issue