Fixing database changes from EF
This commit is contained in:
parent
63038b7278
commit
afca1242bc
|
|
@ -6,7 +6,7 @@ using System.Threading.Tasks;
|
||||||
using Microsoft.AspNet.Identity;
|
using Microsoft.AspNet.Identity;
|
||||||
using Microsoft.AspNet.Identity.EntityFramework;
|
using Microsoft.AspNet.Identity.EntityFramework;
|
||||||
using Microsoft.Data.Entity;
|
using Microsoft.Data.Entity;
|
||||||
using Microsoft.Data.Entity.SqlServer;
|
using Microsoft.Data.Entity.Relational;
|
||||||
using Microsoft.Framework.DependencyInjection;
|
using Microsoft.Framework.DependencyInjection;
|
||||||
using Microsoft.Framework.OptionsModel;
|
using Microsoft.Framework.OptionsModel;
|
||||||
using MusicStore.Spa;
|
using MusicStore.Spa;
|
||||||
|
|
@ -21,7 +21,7 @@ namespace MusicStore.Models
|
||||||
{
|
{
|
||||||
using (var db = serviceProvider.GetService<MusicStoreContext>())
|
using (var db = serviceProvider.GetService<MusicStoreContext>())
|
||||||
{
|
{
|
||||||
var sqlServerDatabase = db.Database as SqlServerDatabase;
|
var sqlServerDatabase = db.Database as RelationalDatabase;
|
||||||
if (sqlServerDatabase != null)
|
if (sqlServerDatabase != null)
|
||||||
{
|
{
|
||||||
if (await sqlServerDatabase.EnsureCreatedAsync())
|
if (await sqlServerDatabase.EnsureCreatedAsync())
|
||||||
|
|
|
||||||
|
|
@ -5,7 +5,7 @@ using System.Security.Claims;
|
||||||
using System.Threading.Tasks;
|
using System.Threading.Tasks;
|
||||||
using Microsoft.AspNet.Identity;
|
using Microsoft.AspNet.Identity;
|
||||||
using Microsoft.Data.Entity;
|
using Microsoft.Data.Entity;
|
||||||
using Microsoft.Data.Entity.SqlServer;
|
using Microsoft.Data.Entity.Relational;
|
||||||
using Microsoft.Framework.ConfigurationModel;
|
using Microsoft.Framework.ConfigurationModel;
|
||||||
using Microsoft.Framework.DependencyInjection;
|
using Microsoft.Framework.DependencyInjection;
|
||||||
using Microsoft.Framework.Runtime;
|
using Microsoft.Framework.Runtime;
|
||||||
|
|
@ -22,7 +22,7 @@ namespace MusicStore.Models
|
||||||
{
|
{
|
||||||
using (var db = serviceProvider.GetService<MusicStoreContext>())
|
using (var db = serviceProvider.GetService<MusicStoreContext>())
|
||||||
{
|
{
|
||||||
var sqlServerDatabase = db.Database as SqlServerDatabase;
|
var sqlServerDatabase = db.Database as RelationalDatabase;
|
||||||
if (sqlServerDatabase != null)
|
if (sqlServerDatabase != null)
|
||||||
{
|
{
|
||||||
if (await sqlServerDatabase.EnsureCreatedAsync())
|
if (await sqlServerDatabase.EnsureCreatedAsync())
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue