Top "Memorycache" questions

The MemoryCache class is a concrete implementation of the abstract ObjectCache class in .Net

Using multiple instances of MemoryCache

I'd like to add caching capabilities to my application using the System.Runtime.Caching namespace, and would probably want to …

c# .net caching .net-4.0 memorycache
What's the difference between MemoryCache.Add and MemoryCache.Set?

I read the MSDN documentation but didn't really understand it. I believe that the behavior of Set is "replace existing, …

.net memorycache
How to check when an item in MemoryCache will expire?

Is it possible to read the expiration time of an item in MemoryCache? I'm using the .NET System.Runtime.Caching.…

c# caching memorycache
How can I use Dependency Injection in a .Net Core ActionFilterAttribute?

AuthenticationRequiredAttribute Class public class AuthenticationRequiredAttribute : ActionFilterAttribute { ILoginTokenKeyApi _loginTokenKeyApi; IMemoryCache _memoryCache; public AuthenticationRequiredAttribute(IMemoryCache memoryCache) { _memoryCache = memoryCache; _loginTokenKeyApi = new LoginTokenKeyController(new …

c# asp.net .net asp.net-core memorycache
Is MemoryCache.Set() thread-safe?

The MSDN documentation for MemoryCache.Set unfortunately doesn’t state explicitly whether it is thread-safe or not. Is it safe …

c# thread-safety memorycache
Get all Cached Objects which are cached using MemoryCache class c#

I want to retrieve all the cache objects that are added using MemoryCache. I tried the below but it is …

c# asp.net .net asp.net-mvc memorycache
How to deal with costly building operations using MemoryCache?

On an ASP.NET MVC project we have several instances of data that requires good amount of resources and time …

c# .net memorycache
MemoryCache.Default not available in .NET Core?

I'm porting some code from .NET 4.6 til .NET Core and have run into some problems with MemoryCache. The 4.6 code is …

c# .net dnx memorycache coreclr
What is MemoryCache.AddOrGetExisting for?

The behaviour of MemoryCache.AddOrGetExisting is described as: Adds a cache entry into the cache using the specified key and …

c# .net memorycache
How to inspect cache policies inside System.Runtime.Caching.ObjectCache?

I'm making use of the new .NET 4.0 Caching namespace: System.Runtime.Caching. Now, i'm just doing some prototype/fiddling with …

c# asp.net caching memorycache