public async Task <IActionResult> Create([Bind("ID,Name,Qty,UnitPrice")] Product product) { if (ModelState.IsValid) { _context.Add(product); await _context.SaveChangesAsync(); return(RedirectToAction(nameof(Index))); } return(View(product)); }
public async Task <IActionResult> Create([Bind("ID,Name,Address,City,State,Zip,Phone")] Vendor vendor) { if (ModelState.IsValid) { _context.Add(vendor); await _context.SaveChangesAsync(); return(RedirectToAction(nameof(Index))); } return(View(vendor)); }