예제 #1
0
        public void AddAuctionOffer(AuctionOffer auctionOffer)
        {
            if (_exchangeContext.Auctions.Any(a => a.Id == auctionOffer.AuctionId && a.PredictedEndDate < DateTime.Now))
                return;

            if(_exchangeContext.AuctionOffers.Any(a => a.AuctionId == auctionOffer.Id && a.Price >= auctionOffer.Price))
                return;

            _exchangeContext.AuctionOffers.Add(auctionOffer);
            _exchangeContext.SaveChanges();
        }
예제 #2
0
        public void AddAuctionOffer(AuctionOffer auctionOffer)
        {
            if (_exchangeContext.Auctions.Any(a => a.Id == auctionOffer.AuctionId && a.PredictedEndDate < DateTime.Now))
            {
                return;
            }

            if (_exchangeContext.AuctionOffers.Any(a => a.AuctionId == auctionOffer.Id && a.Price >= auctionOffer.Price))
            {
                return;
            }

            _exchangeContext.AuctionOffers.Add(auctionOffer);
            _exchangeContext.SaveChanges();
        }