public void SaveContactGridData(ContactGridViewModel model, Guid guid) { string key = "contactsgrid" + guid.ToString(); DateTimeOffset offSetValue = new DateTimeOffset(DateTime.UtcNow).AddHours(10); cacheManager.Add(key, model, offSetValue); }
public ContactGridViewModel GetGridViewModel(string key) { ContactGridViewModel model = new ContactGridViewModel(); if (key != null) { string keyValue = "contactsgrid" + key; if (cacheManager.IsExists(keyValue)) { model = cacheManager.Get <ContactGridViewModel>(keyValue); } } return(model); }