예제 #1
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();
            }
        }
예제 #2
0
        public ActionResult Create(CreateAuctionViewModel model)
        {
            _repo.CreateAuction(model);

            return RedirectToAction("Index");
        }