public static ShowcaseAttributeHeader GetByID(int ShowcaseAttributeHeaderID, IEnumerable <string> includeList = null) { ShowcaseAttributeHeader obj = null; string key = cacheKeyPrefix + ShowcaseAttributeHeaderID + GetCacheIncludeText(includeList); ShowcaseAttributeHeader tmpClass = null; if (Cache.IsEnabled) { if (Cache.IsEmptyCacheItem(key)) { return(null); } tmpClass = Cache[key] as ShowcaseAttributeHeader; } if (tmpClass != null) { obj = tmpClass; } else { using (Entities entity = new Entities()) { IQueryable <ShowcaseAttributeHeader> itemQuery = AddIncludes(entity.ShowcaseAttributeHeader, includeList); obj = itemQuery.FirstOrDefault(n => n.ShowcaseAttributeHeaderID == ShowcaseAttributeHeaderID); } Cache.Store(key, obj); } return(obj); }
public ShowcaseAttributeHeader(ShowcaseAttributeHeader objectToCopy) { NoPreferenceColumn = objectToCopy.NoPreferenceColumn; ShowcaseAttributeHeaderID = objectToCopy.ShowcaseAttributeHeaderID; ShowcaseAttributeID = objectToCopy.ShowcaseAttributeID; Text = objectToCopy.Text; }