Beispiel #1
0
        public EntityUpdateStatus <long> UpdateCacheItem(ListingCacheDTO cache)
        {
            var dbItem = unitOfWork.GetSet <ListingCache>()
                         .FirstOrDefault(c => c.Id == cache.Id);

            if (dbItem == null)
            {
                dbItem    = new ListingCache();
                dbItem.Id = cache.Id;
                unitOfWork.GetSet <ListingCache>().Add(dbItem);
            }

            UpdateCacheItem(dbItem, cache);

            unitOfWork.Commit();

            return(null);
        }
Beispiel #2
0
        private void UpdateCacheItem(ListingCache item, ListingCacheDTO dto)
        {
            item.Id     = dto.Id;
            item.ItemId = dto.ItemId;

            item.SoldQuantity = dto.SoldQuantity;
            item.MaxOrderDate = dto.MaxOrderDate;

            //item.MarketplaceId = dto.MarketplaceId;

            item.IsDirty = false;

            if (item.CreateDate == null)
            {
                item.CreateDate = dto.CreateDate;
            }

            //Note: disable for speed up updating
            //item.UpdateDate = dto.UpdateDate;
        }