public async Task <IActionResult> Edit(int id, [Bind("ID,Description,Size,Colour,Quantity")] HighVisibility highVisibility) { if (id != highVisibility.ID) { return(NotFound()); } if (ModelState.IsValid) { try { _context.Update(highVisibility); await _context.SaveChangesAsync(); } catch (DbUpdateConcurrencyException) { if (!HighVisibilityExists(highVisibility.ID)) { return(NotFound()); } else { throw; } } return(RedirectToAction(nameof(Index))); } return(View(highVisibility)); }
public async Task <IActionResult> Create([Bind("ID,Description,Size,Colour,Quantity")] HighVisibility highVisibility) { if (ModelState.IsValid) { _context.Add(highVisibility); await _context.SaveChangesAsync(); return(RedirectToAction(nameof(Index))); } return(View(highVisibility)); }