public async Task <IActionResult> Create([Bind("ProductId,ProductName,Category,UnitPrice,UnitsInStock")] Product product, IFormFile file) { if (ModelState.IsValid) { _context.Add(product); await _context.SaveChangesAsync(); } return(RedirectToAction("Index", "Products")); }
public async Task <IActionResult> Create([Bind("IdProduct,ProductCode,ProductType,ProductDescription,UnitPrice,QtyStock")] Product product) { if (ModelState.IsValid) { _context.Add(product); await _context.SaveChangesAsync(); return(RedirectToAction(nameof(Index))); } return(View(product)); }
public async Task <IActionResult> Create([Bind("playerId,playerName,playerNumber,teamName")] Player player) { if (ModelState.IsValid) { _context.Add(player); await _context.SaveChangesAsync(); return(RedirectToAction(nameof(Index))); } return(View(player)); }