//Prepares the create bid form public IActionResult OnGet() { ViewData["BuyerId"] = new SelectList(_context.Set <Buyer>(), "Id", "BuyerRegistrationId"); ViewData["ProductId"] = new SelectList(_context.Set <Product>(), "Id", "ProductRegistrationId"); ViewData["SellerId"] = new SelectList(_context.Set <Seller>(), "Id", "SellerRegistrationNumber"); return(Page()); }
//Gets the bid record for updating using a lamda query. public IActionResult OnGet(int?id) { if (id == null) { return(NotFound()); } Bid = _context.Bid .Include(b => b.Buyer) .Include(b => b.Product) .Include(b => b.Seller).FirstOrDefault(m => m.Id == id); if (Bid == null) { return(NotFound()); } ViewData["BuyerId"] = new SelectList(_context.Set <Buyer>(), "Id", "BuyerRegistrationId", Bid.Buyer.Id); ViewData["ProductId"] = new SelectList(_context.Set <Product>(), "Id", "ProductRegistrationId", Bid.Product.Id); ViewData["SellerId"] = new SelectList(_context.Set <Seller>(), "Id", "SellerRegistrationNumber", Bid.Seller.Id); return(Page()); }