Search code examples
.netmemorycache

How to update absolute expiration of existing cache items in MemoryCache.Default


I am using C# and .NET and I have a CacheItem stored in the MemoryCache.Default.

All I want is to update its absolute expiration without to reinserting it.

I want to just get the CacheItem and update its expiration.

Any help would be appreciated.


Solution

  • I have found it.

    There is a 'Set' method in the MemoryCache object.

    Thank you all.