public void RetrieveKey(int id) { var key = TicketKeyHelper.Retrieve(id); Run(cacheMock => SetupRetrieve <Ticket>(cacheMock, key).Retrieve(id), cacheMock => SetupRetrieveAndStore <Ticket>(cacheMock, key).Retrieve(id), cacheMock => SetupRemove(cacheMock, key).UpdateTicket("x", new Ticket() { TicketId = id })); }
public static void Ticket(ICache cache, int ticketId) { //// cache.Remove(TicketKeyHelper.Retrieve(ticketId)); var keys = new[] { TicketKeyHelper.Retrieve(ticketId) }; keys.ForEach(key => cache.Remove(key)); new LinkedCacheDependency(cache, TicketKeyHelper.TicketDependency(), DateTime.MinValue).Remove(); }
public override Ticket Retrieve(int identity) { var key = TicketKeyHelper.Retrieve(identity); return(CacheHelper.Get(cache, key, () => base.Retrieve(identity), ItemLifetime)); }