public async Task <IActionResult> Create([Bind("VendorID,Name,Status,Phone,Email")] Vendor vendor) { if (ModelState.IsValid) { _context.Add(vendor); await _context.SaveChangesAsync(); return(RedirectToAction(nameof(Index))); } return(View(vendor)); }
public async Task <IActionResult> Create([Bind("ProductID,Description,QtyonHand,ReorderPoint,Status,Cost,Price,VendorID")] Product product) { if (ModelState.IsValid) { _context.Add(product); await _context.SaveChangesAsync(); return(RedirectToAction(nameof(Index))); } ViewData["VendorID"] = new SelectList(_context.Vendor, "VendorID", "Name", product.VendorID); return(View(product)); }