Example #1
0
        public IActionResult Bid(int auctionid)
        {
            // Populate the new Bid
            Bid bid = new Bid();

            bid.User = fetchuser();
            // Use the Context method to properly populate auction
            bid.Auction = _context.PopulateAuctionSingle(auctionid);
            // Make sure the auction id is set
            bid.AuctionId = auctionid;
            // Check to make sure user is logged in
            var result = user_check(model: bid);

            // ViewBag details
            ViewBag.topbid = bid.Auction.GetTopBid();
            // Render the view with the User Model
            return(result);
        }