Esempio n. 1
0
        public void Handle(AcceptOfferCommand command)
        {
            var offer = _context.Offers.Find(command.OfferId);

            offer.UpdatedAt = DateTime.Now;
            offer.Status    = Status.Accepted;

            _context.SaveChanges();
        }
        public void Handle(AcceptOfferCommand command)
        {
            var offer = _context.Offers.FirstOrDefault(o => o.Id == command.OfferId);

            offer.UpdatedAt = DateTime.Now;
            offer.Status    = OfferStatus.Accepted;

            _context.SaveChanges();
        }
        public void Handle(AcceptOfferCommand command)
        {
            var offer    = _context.Offers.Find(command.OfferId);
            var property = _context.Properties.Find(command.PropertyId);

            offer.UpdatedAt          = DateTime.Now;
            offer.Status             = OfferStatus.Accepted;
            property.IsListedForSale = false;

            _context.SaveChanges();
        }