Exemplo n.º 1
0
        public static RetsStatus GetByID(int RetsStatusID, IEnumerable <string> includeList = null)
        {
            RetsStatus obj = null;
            string     key = cacheKeyPrefix + RetsStatusID + GetCacheIncludeText(includeList);

            RetsStatus tmpClass = null;

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

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

            return(obj);
        }
Exemplo n.º 2
0
 public RetsStatus(RetsStatus objectToCopy)
 {
     Name         = objectToCopy.Name;
     RetsStatusID = objectToCopy.RetsStatusID;
 }