Beispiel #1
0
        public static List<ResLabel> GetLabelsByResourceSet(string resourceSet)
        {
            var result = new List<ResLabel>();

            var cache = new CacheManager<List<ResLabel>>(CacheKeyPrefix);
            if (cache.IsEmpty(resourceSet))
            {
                var man = new LabelsManager();
                var filter = new LabelsFilter();
                filter.ResourceSet = resourceSet;
                result = man.GetByFilter(filter, "");

                cache.Insert(resourceSet, result);
            }
            else
            {
                result = cache.GetValue(resourceSet);
            }
            return result;
        }
Beispiel #2
0
        private static List<ResLabel> getLabelsByResourceId(string resourceSet, string resourceId)
        {
            var result = new List<ResLabel>();

            var cache = new CacheManager<List<ResLabel>>(CacheKeyPrefix);
            string key = resourceSet + "_" + resourceId;
            if (cache.IsEmpty(key))
            {
                var man = new LabelsManager();
                var filter = new LabelsFilter();
                filter.ResourceSet = resourceSet;
                filter.ResourceId = resourceId;
                result = man.GetByFilter(filter, "");

                cache.Insert(key, result);
            }
            else
            {
                result = cache.GetValue(key);
            }
            return result;
        }