using System.Runtime.Caching;
public string Name {get; set;}
private static ObjectCache _cache = MemoryCache.Default;
public static void Main()
var i = new Item { Name = "Manolo" };
var t1 = new Tuple<Item, string>(i, "texto 1");
var t2 = Get<Tuple<Item, string>>("tuple1");
Console.WriteLine(t1.Item1.Name);
Console.WriteLine(t2.Item1.Name);
private static void Set<T>(string key, T value)
var cacheItem = new CacheItem(key, value);
var policy = new CacheItemPolicy();
_cache.Set(cacheItem, policy);
private static T Get<T>(string key)