public TemplateModel GetTemplateByGuid(string guid, bool IsRelease = true) { MemcachedCache mc = new MemcachedCache(); if (mc.Get <TemplateModel>(cacheHeader + guid.ToLower()) == null) { AddTemplateByGuid(guid.ToLower()); } TemplateModel model = mc.Get <TemplateModel>(cacheHeader + guid.ToLower()); if (model == null || (!model.IsReleased && IsRelease)) { return(null); } return(model); }
public void RemoveTemplateByGuid(string guid) { MemcachedCache mc = new MemcachedCache(); if (mc.Get <TemplateModel>(cacheHeader + guid.ToLower()) != null) { mc.Remove(cacheHeader + guid.ToLower()); } }