public async Task <IActionResult> Edit(int id, [Bind("Id,Club,Team,Role,Sport,District,FirstName,LastName,PhoneNumber1,PhoneNumber2,Email,Ssn,Season,AgeCategory")] ContactRaw contactRaw) { if (id != contactRaw.Id) { return(NotFound()); } if (ModelState.IsValid) { try { _context.Update(contactRaw); await _context.SaveChangesAsync(); } catch (DbUpdateConcurrencyException) { if (!ContactRawExists(contactRaw.Id)) { return(NotFound()); } else { throw; } } return(RedirectToAction(nameof(Index))); } return(View(contactRaw)); }
public async Task <IActionResult> Create([Bind("Id,Club,Team,Role,Sport,District,FirstName,LastName,PhoneNumber1,PhoneNumber2,Email,Ssn,Season,AgeCategory")] ContactRaw contactRaw) { if (ModelState.IsValid) { _context.Add(contactRaw); await _context.SaveChangesAsync(); return(RedirectToAction(nameof(Index))); } return(View(contactRaw)); }