public async Task <IActionResult> Edit(int id, [Bind("ID,InteractionDate,rating,reviewText")] Review review) { if (id != review.ID) { return(NotFound()); } if (ModelState.IsValid) { try { _context.Update(review); await _context.SaveChangesAsync(); } catch (DbUpdateConcurrencyException) { if (!ReviewExists(review.ID)) { return(NotFound()); } else { throw; } } return(RedirectToAction(nameof(Index))); } return(View(review)); }
public async Task <IActionResult> Edit(int id, [Bind("Id,fName,lName,streetAddress,city,state,phoneNumber,email")] Customer customer) { if (id != customer.Id) { return(NotFound()); } if (ModelState.IsValid) { try { _context.Update(customer); await _context.SaveChangesAsync(); } catch (DbUpdateConcurrencyException) { if (!CustomerExists(customer.Id)) { return(NotFound()); } else { throw; } } return(RedirectToAction(nameof(Index))); } return(View(customer)); }
public async Task <IActionResult> Edit(int id, [Bind("Id,fName,lName,streetAddress,city,state,phoneNumber,email,profession,rate,averageRating,company,image")] Professional professional) { if (id != professional.Id) { return(NotFound()); } if (ModelState.IsValid) { try { _context.Update(professional); await _context.SaveChangesAsync(); } catch (DbUpdateConcurrencyException) { if (!ProfessionalExists(professional.Id)) { return(NotFound()); } else { throw; } } return(RedirectToAction(nameof(Index))); } return(View(professional)); }