public async Task <IActionResult> Edit(int id, [Bind("ID,FirstName,Surname,Phone,Address")] Customercs customercs) { if (id != customercs.ID) { return(NotFound()); } if (ModelState.IsValid) { try { _context.Update(customercs); await _context.SaveChangesAsync(); } catch (DbUpdateConcurrencyException) { if (!CustomercsExists(customercs.ID)) { return(NotFound()); } else { throw; } } return(RedirectToAction(nameof(Index))); } return(View(customercs)); }
public async Task <IActionResult> Create([Bind("ID,FirstName,Surname,Phone,Address")] Customercs customercs) { if (ModelState.IsValid) { _context.Add(customercs); await _context.SaveChangesAsync(); return(RedirectToAction(nameof(Index))); } return(View(customercs)); }