public async Task <IActionResult> Edit(int id, [Bind("Id,Subject,Topic,SchoolType,Experience,StudyDate,AddressLine1,AddressLine2,City,State,Country,ZipCode")] Request request) { if (id != request.Id) { return(NotFound()); } if (ModelState.IsValid) { try { _context.Update(request); await _context.SaveChangesAsync(); } catch (DbUpdateConcurrencyException) { if (!RequestExists(request.Id)) { return(NotFound()); } else { throw; } } return(RedirectToAction(nameof(Index))); } return(View(request)); }
public async Task <IActionResult> Edit(int id, [Bind("Id,Username,Password,FirstName,LastName,Gender,Dob,Email,StreetAddress,City,Country,ZipCode,Phone")] Users users) { if (id != users.Id) { return(NotFound()); } if (ModelState.IsValid) { try { _context.Update(users); await _context.SaveChangesAsync(); } catch (DbUpdateConcurrencyException) { if (!UsersExists(users.Id)) { return(NotFound()); } else { throw; } } return(RedirectToAction(nameof(Index))); } return(View(users)); }