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