public async Task <IActionResult> Edit(uint id, [Bind("Id,RoleID,Name,Email,Phone,Pwd")] Participatant participatant) { if (id != participatant.Id) { return(NotFound()); } if (ModelState.IsValid) { try { _context.Update(participatant); await _context.SaveChangesAsync(); } catch (DbUpdateConcurrencyException) { if (!ParticipatantExists(participatant.Id)) { return(NotFound()); } else { throw; } } return(RedirectToAction(nameof(Index))); } return(View(participatant)); }
public async Task <IActionResult> Create([Bind("Id,RoleID,Name,Email,Phone,Pwd")] Participatant participatant) { if (ModelState.IsValid) { _context.Add(participatant); await _context.SaveChangesAsync(); return(RedirectToAction(nameof(Index))); } return(View(participatant)); }