Removing the InMemory store for EF data in CoreCLR.
This commit is contained in:
parent
dcc55c97ba
commit
909941fa51
|
|
@ -1,7 +1,6 @@
|
||||||
using Microsoft.Framework.ConfigurationModel;
|
using Microsoft.Framework.ConfigurationModel;
|
||||||
using Microsoft.Data.Entity;
|
using Microsoft.Data.Entity;
|
||||||
using Microsoft.Data.Entity.Metadata;
|
using Microsoft.Data.Entity.Metadata;
|
||||||
using Microsoft.Data.Entity.InMemory;
|
|
||||||
using Microsoft.Data.Entity.SqlServer;
|
using Microsoft.Data.Entity.SqlServer;
|
||||||
using System;
|
using System;
|
||||||
|
|
||||||
|
|
@ -26,11 +25,7 @@ namespace MusicStore.Models
|
||||||
|
|
||||||
protected override void OnConfiguring(DbContextOptions builder)
|
protected override void OnConfiguring(DbContextOptions builder)
|
||||||
{
|
{
|
||||||
#if NET45
|
|
||||||
builder.UseSqlServer(_configuration.Get("Data:DefaultConnection:ConnectionString"));
|
builder.UseSqlServer(_configuration.Get("Data:DefaultConnection:ConnectionString"));
|
||||||
#else
|
|
||||||
builder.UseInMemoryStore(persist: true);
|
|
||||||
#endif
|
|
||||||
}
|
}
|
||||||
|
|
||||||
protected override void OnModelCreating(ModelBuilder builder)
|
protected override void OnModelCreating(ModelBuilder builder)
|
||||||
|
|
|
||||||
|
|
@ -43,10 +43,8 @@ public class Startup
|
||||||
//Add all MVC related services to IoC.
|
//Add all MVC related services to IoC.
|
||||||
services.AddMvc();
|
services.AddMvc();
|
||||||
|
|
||||||
/*Add all EF related services to IoC.
|
/*Add all EF related services to IoC.*/
|
||||||
Using an InMemoryStore in K until SQL server is available.*/
|
|
||||||
services.AddEntityFramework().AddSqlServer();
|
services.AddEntityFramework().AddSqlServer();
|
||||||
services.AddEntityFramework().AddInMemoryStore();
|
|
||||||
services.AddTransient<MusicStoreContext>();
|
services.AddTransient<MusicStoreContext>();
|
||||||
|
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue