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