コード例 #1
0
        public static WhatsNearByLocationCategory GetByID(int WhatsNearByLocationCategoryID, IEnumerable <string> includeList = null)
        {
            WhatsNearByLocationCategory obj = null;
            string key = cacheKeyPrefix + WhatsNearByLocationCategoryID + GetCacheIncludeText(includeList);

            WhatsNearByLocationCategory tmpClass = null;

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

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

            return(obj);
        }
コード例 #2
0
 public WhatsNearByLocationCategory(WhatsNearByLocationCategory objectToCopy)
 {
     WhatsNearByCategoryID         = objectToCopy.WhatsNearByCategoryID;
     WhatsNearByLocationCategoryID = objectToCopy.WhatsNearByLocationCategoryID;
     WhatsNearByLocationID         = objectToCopy.WhatsNearByLocationID;
 }