Example #1
0
        public void AddBid(CreateBidViewModel model)
        {
            using (AuctionDbContext db = new AuctionDbContext())
            {
                Bid dbBid = new Bid
                {
                    AuctionItemId = model.AuctionItemId,
                    BidAmount     = model.BidAmount,
                    Name          = model.Name
                };

                db.Bids.Add(dbBid);
                db.SaveChanges();
            }
        }
Example #2
0
        public void AddBid(CreateBidViewModel model)
        {
            using (AuctionDbContext db = new AuctionDbContext())
            {
                Bid dbBid = new Bid
                {
                    AuctionItemId = model.AuctionItemId,
                    BidAmount = model.BidAmount,
                    Name = model.Name
                };

                db.Bids.Add(dbBid);
                db.SaveChanges();
            }
        }
Example #3
0
        public void CreateAuction(CreateAuctionViewModel model)
        {
            using (AuctionDbContext db = new AuctionDbContext())
            {
                AuctionItem dbAuction = new AuctionItem
                {
                    Description = model.Description,
                    MinimumBid = model.MinimumBid,
                    Name = model.Name,
                    NumberOfBids = model.NumberOfBids
                };

                db.AuctionItems.Add(dbAuction);
                db.SaveChanges();
            }
        }
Example #4
0
        public void CreateAuction(CreateAuctionViewModel model)
        {
            using (AuctionDbContext db = new AuctionDbContext())
            {
                AuctionItem dbAuction = new AuctionItem
                {
                    Description  = model.Description,
                    MinimumBid   = model.MinimumBid,
                    Name         = model.Name,
                    NumberOfBids = model.NumberOfBids
                };

                db.AuctionItems.Add(dbAuction);
                db.SaveChanges();
            }
        }