Esempio n. 1
0
        public Task UpdateAsync(BL.Model.Offer offer)
        {
            if (offer == null)
            {
                throw new ArgumentNullException(nameof(offer));
            }

            var dbOffer = _mapper.Map <DL.Offer>(offer);

            _dbContext.Entry(dbOffer).State = EntityState.Modified;
            _dbContext.Entry(dbOffer).Property(t => t.Price).IsModified   = false;
            _dbContext.Entry(dbOffer).Property(t => t.PlaceId).IsModified = false;

            return(_dbContext.SaveChangesAsync());
        }
Esempio n. 2
0
        public Task UpdateAsync(BL.Model.Place place)
        {
            if (place == null)
            {
                throw new ArgumentNullException(nameof(place));
            }

            var dbPlace = _mapper.Map <DL.Place>(place);

            _dbContext.Entry <DL.Place>(dbPlace).State = EntityState.Modified;

            return(_dbContext.SaveChangesAsync());
        }