Ejemplo n.º 1
0
        public static ShowcaseItemAttributeValue GetByID(int ShowcaseItemAttributeValueID, IEnumerable <string> includeList = null)
        {
            ShowcaseItemAttributeValue obj = null;
            string key = cacheKeyPrefix + ShowcaseItemAttributeValueID + GetCacheIncludeText(includeList);

            ShowcaseItemAttributeValue tmpClass = null;

            if (Cache.IsEnabled)
            {
                if (Cache.IsEmptyCacheItem(key))
                {
                    return(null);
                }
                tmpClass = Cache[key] as ShowcaseItemAttributeValue;
            }

            if (tmpClass != null)
            {
                obj = tmpClass;
            }
            else
            {
                using (Entities entity = new Entities())
                {
                    IQueryable <ShowcaseItemAttributeValue> itemQuery = AddIncludes(entity.ShowcaseItemAttributeValue, includeList);
                    obj = itemQuery.FirstOrDefault(n => n.ShowcaseItemAttributeValueID == ShowcaseItemAttributeValueID);
                }
                Cache.Store(key, obj);
            }

            return(obj);
        }
Ejemplo n.º 2
0
 public ShowcaseItemAttributeValue(ShowcaseItemAttributeValue objectToCopy)
 {
     ShowcaseAttributeValueID     = objectToCopy.ShowcaseAttributeValueID;
     ShowcaseItemAttributeValueID = objectToCopy.ShowcaseItemAttributeValueID;
     ShowcaseItemID = objectToCopy.ShowcaseItemID;
 }