예제 #1
0
        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);
        }
예제 #2
0
        public void RemoveTemplateByGuid(string guid)
        {
            MemcachedCache mc = new MemcachedCache();

            if (mc.Get <TemplateModel>(cacheHeader + guid.ToLower()) != null)
            {
                mc.Remove(cacheHeader + guid.ToLower());
            }
        }