Skip to content

Instantly share code, notes, and snippets.

@eocron
eocron / ObjectCache.cs
Last active October 27, 2017 22:21
Easy to user key value wrap around .NET MemoryCache
using System;
using System.Runtime.Caching;
namespace Helpers
{
public interface IObjectCache<in TKey, TValue>
{
bool AddOrUpdateSlide(TKey key, TValue value, TimeSpan expiration);
TValue GetOrAddSlide(TKey key, TimeSpan expiration);