public async Task <IActionResult> Edit(int id, [Bind("Id")] VendorItemCategory vendorItemCategory) { if (id != vendorItemCategory.Id) { return(NotFound()); } if (ModelState.IsValid) { try { _context.Update(vendorItemCategory); await _context.SaveChangesAsync(); } catch (DbUpdateConcurrencyException) { if (!VendorItemCategoryExists(vendorItemCategory.Id)) { return(NotFound()); } else { throw; } } return(RedirectToAction(nameof(Index))); } return(View(vendorItemCategory)); }
public async Task <IActionResult> Create([Bind("Id")] VendorItemCategory vendorItemCategory) { if (ModelState.IsValid) { _context.Add(vendorItemCategory); await _context.SaveChangesAsync(); return(RedirectToAction(nameof(Index))); } return(View(vendorItemCategory)); }