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