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