public async Task <IActionResult> Create([Bind("ProductId,ProductName,Description,Price,Quantity,Category")] Product product) { if (ModelState.IsValid) { _context.Add(product); await _context.SaveChangesAsync(); return(RedirectToAction(nameof(Index))); } return(View(product)); }
public async Task <IActionResult> Create([Bind("Created,Id,Name,Description")] InventoryItem inventoryItem) { if (ModelState.IsValid) { _context.Add(inventoryItem); await _context.SaveChangesAsync(); return(RedirectToAction(nameof(Index))); } return(View(inventoryItem)); }