Example #1
0
        public async Task <IActionResult> Create([Bind("ID,Name,Description,AuctionEndTime,ItemState")] AuctionItem auctionItem)
        {
            if (ModelState.IsValid)
            {
                _context.Add(auctionItem);
                await _context.SaveChangesAsync();

                return(RedirectToAction(nameof(Index)));
            }
            return(View(auctionItem));
        }
Example #2
0
        public async Task <IActionResult> Create([Bind("ID,BuyerName,OfferTime,Price")] Offer offer)
        {
            if (ModelState.IsValid)
            {
                _context.Add(offer);
                await _context.SaveChangesAsync();

                return(RedirectToAction(nameof(Index)));
            }
            return(View(offer));
        }