Update MemoryCache DI.

This commit is contained in:
Chris Ross 2014-10-20 11:30:53 -07:00
parent cd9362c92b
commit 390bf8f024
3 changed files with 3 additions and 6 deletions

View File

@ -92,8 +92,7 @@ namespace MusicStore
services.AddSignalR();
//Add InMemoryCache
//Currently not able to AddSingleTon
services.AddInstance<IMemoryCache>(new MemoryCache());
services.AddSingleton<IMemoryCache, MemoryCache>();
});
//To gracefully shutdown the server - Not for production scenarios

View File

@ -84,8 +84,7 @@ namespace MusicStore
services.AddSignalR();
//Add InMemoryCache
//Currently not able to AddSingleTon
services.AddInstance<IMemoryCache>(new MemoryCache());
services.AddSingleton<IMemoryCache, MemoryCache>();
}
//This method is invoked when KRE_ENV is 'Development' or is not defined

View File

@ -86,8 +86,7 @@ namespace MusicStore
services.AddSignalR();
//Add InMemoryCache
//Currently not able to AddSingleTon
services.AddInstance<IMemoryCache>(new MemoryCache());
services.AddSingleton<IMemoryCache, MemoryCache>();
});
//Configure SignalR