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