From 390bf8f024e48d541676b77deeadf6ebc374ed75 Mon Sep 17 00:00:00 2001 From: Chris Ross Date: Mon, 20 Oct 2014 11:30:53 -0700 Subject: [PATCH] Update MemoryCache DI. --- src/MusicStore/Mocks/StartupSocialTesting.cs | 3 +-- src/MusicStore/Startup.cs | 3 +-- src/MusicStore/StartupNtlmAuthentication.cs | 3 +-- 3 files changed, 3 insertions(+), 6 deletions(-) diff --git a/src/MusicStore/Mocks/StartupSocialTesting.cs b/src/MusicStore/Mocks/StartupSocialTesting.cs index d79a7fc8a6..8159a7ac97 100644 --- a/src/MusicStore/Mocks/StartupSocialTesting.cs +++ b/src/MusicStore/Mocks/StartupSocialTesting.cs @@ -92,8 +92,7 @@ namespace MusicStore services.AddSignalR(); //Add InMemoryCache - //Currently not able to AddSingleTon - services.AddInstance(new MemoryCache()); + services.AddSingleton(); }); //To gracefully shutdown the server - Not for production scenarios diff --git a/src/MusicStore/Startup.cs b/src/MusicStore/Startup.cs index a340293977..3f60ba41d5 100644 --- a/src/MusicStore/Startup.cs +++ b/src/MusicStore/Startup.cs @@ -84,8 +84,7 @@ namespace MusicStore services.AddSignalR(); //Add InMemoryCache - //Currently not able to AddSingleTon - services.AddInstance(new MemoryCache()); + services.AddSingleton(); } //This method is invoked when KRE_ENV is 'Development' or is not defined diff --git a/src/MusicStore/StartupNtlmAuthentication.cs b/src/MusicStore/StartupNtlmAuthentication.cs index cb0e7435de..b99ca6e4fa 100644 --- a/src/MusicStore/StartupNtlmAuthentication.cs +++ b/src/MusicStore/StartupNtlmAuthentication.cs @@ -86,8 +86,7 @@ namespace MusicStore services.AddSignalR(); //Add InMemoryCache - //Currently not able to AddSingleTon - services.AddInstance(new MemoryCache()); + services.AddSingleton(); }); //Configure SignalR