Esempio n. 1
0
        public static ShowcaseItemRental GetByID(int ShowcaseItemRentalID, IEnumerable <string> includeList = null)
        {
            ShowcaseItemRental obj = null;
            string             key = cacheKeyPrefix + ShowcaseItemRentalID + GetCacheIncludeText(includeList);

            ShowcaseItemRental tmpClass = null;

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

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

            return(obj);
        }
Esempio n. 2
0
 public ShowcaseItemRental(ShowcaseItemRental objectToCopy)
 {
     CompanyName          = objectToCopy.CompanyName;
     ContactName          = objectToCopy.ContactName;
     ContactPhone         = objectToCopy.ContactPhone;
     LeaseBeginDate       = objectToCopy.LeaseBeginDate;
     OwnerName            = objectToCopy.OwnerName;
     ShowcaseItemID       = objectToCopy.ShowcaseItemID;
     ShowcaseItemRentalID = objectToCopy.ShowcaseItemRentalID;
 }