AddOptions, which is apparently not brought in my memory cache anymore.

This commit is contained in:
Arthur Vickers 2016-03-15 15:56:43 -07:00
parent dc34c630b7
commit 6116f0e2e8
12 changed files with 13 additions and 0 deletions

View File

@ -47,6 +47,7 @@ namespace MusicStore
// Add EF services to the services container
if (useInMemoryStore)
{
services.AddOptions();
services
.AddEntityFrameworkInMemoryDatabase()
.AddDbContext<MusicStoreContext>((p, b) => b.UseInMemoryDatabase().UseInternalServiceProvider(p));

View File

@ -53,6 +53,7 @@ namespace MusicStore
// Add EF services to the services container
if (useInMemoryStore)
{
services.AddOptions();
services
.AddEntityFrameworkInMemoryDatabase()
.AddDbContext<MusicStoreContext>((p, b) => b.UseInMemoryDatabase().UseInternalServiceProvider(p));

View File

@ -42,6 +42,7 @@ namespace MusicStore
// Add EF services to the services container
if (useInMemoryStore)
{
services.AddOptions();
services
.AddEntityFrameworkInMemoryDatabase()
.AddDbContext<MusicStoreContext>((p, b) => b.UseInMemoryDatabase().UseInternalServiceProvider(p));

View File

@ -57,6 +57,7 @@ namespace MusicStore
// Add EF services to the services container
if (useInMemoryStore)
{
services.AddOptions();
services
.AddEntityFrameworkInMemoryDatabase()
.AddDbContext<MusicStoreContext>((p, b) => b.UseInMemoryDatabase().UseInternalServiceProvider(p));

View File

@ -21,6 +21,7 @@ namespace MusicStore.Components
{
var services = new ServiceCollection();
services.AddOptions();
services
.AddEntityFrameworkInMemoryDatabase()
.AddDbContext<MusicStoreContext>((p, b) => b.UseInMemoryDatabase().UseInternalServiceProvider(p));

View File

@ -23,6 +23,7 @@ namespace MusicStore.Controllers
{
var services = new ServiceCollection();
services.AddOptions();
services
.AddEntityFrameworkInMemoryDatabase()
.AddDbContext<MusicStoreContext>((p, b) => b.UseInMemoryDatabase().UseInternalServiceProvider(p));

View File

@ -17,6 +17,7 @@ namespace MusicStore.Components
public GenreMenuComponentTest()
{
var services = new ServiceCollection();
services.AddOptions();
services
.AddEntityFrameworkInMemoryDatabase()
.AddDbContext<MusicStoreContext>((p, b) => b.UseInMemoryDatabase().UseInternalServiceProvider(p));

View File

@ -19,6 +19,7 @@ namespace MusicStore.Controllers
{
var services = new ServiceCollection();
services.AddOptions();
services
.AddEntityFrameworkInMemoryDatabase()
.AddDbContext<MusicStoreContext>((p, b) => b.UseInMemoryDatabase().UseInternalServiceProvider(p));

View File

@ -24,6 +24,7 @@ namespace MusicStore.Controllers
public ManageControllerTest()
{
var services = new ServiceCollection();
services.AddOptions();
services
.AddEntityFrameworkInMemoryDatabase()
.AddDbContext<MusicStoreContext>((p, b) => b.UseInMemoryDatabase().UseInternalServiceProvider(p));
@ -32,6 +33,7 @@ namespace MusicStore.Controllers
.AddEntityFrameworkStores<MusicStoreContext>();
services.AddLogging();
services.AddOptions();
// IHttpContextAccessor is required for SignInManager, and UserManager
var context = new DefaultHttpContext();

View File

@ -46,6 +46,7 @@ namespace MusicStore.Test
public ShoppingCartFixture()
{
var services = new ServiceCollection();
services.AddOptions();
services
.AddEntityFrameworkInMemoryDatabase()
.AddDbContext<MusicStoreContext>((p, b) => b.UseInMemoryDatabase().UseInternalServiceProvider(p));

View File

@ -26,6 +26,7 @@ namespace MusicStore.Controllers
{
var services = new ServiceCollection();
services.AddOptions();
services
.AddEntityFrameworkInMemoryDatabase()
.AddDbContext<MusicStoreContext>((p, b) => b.UseInMemoryDatabase().UseInternalServiceProvider(p));

View File

@ -19,6 +19,7 @@ namespace MusicStore.Controllers
{
var services = new ServiceCollection();
services.AddOptions();
services
.AddEntityFrameworkInMemoryDatabase()
.AddDbContext<MusicStoreContext>((p, b) => b.UseInMemoryDatabase().UseInternalServiceProvider(p));