public async Task <IActionResult> Edit(int id, [Bind("InquirerId,FirstName,LastName,PhoneNumber,EmailAddress,DateCreated")] Inquirers inquirers) { if (id != inquirers.InquirerId) { return(NotFound()); } if (ModelState.IsValid) { try { _context.Update(inquirers); await _context.SaveChangesAsync(); } catch (DbUpdateConcurrencyException) { if (!InquirersExists(inquirers.InquirerId)) { return(NotFound()); } else { throw; } } return(RedirectToAction(nameof(Index))); } return(View(inquirers)); }
public async Task <IActionResult> Create([Bind("InquirerId,FirstName,LastName,PhoneNumber,EmailAddress,DateCreated")] Inquirers inquirers) { if (ModelState.IsValid) { _context.Add(inquirers); await _context.SaveChangesAsync(); return(RedirectToAction(nameof(Index))); } return(View(inquirers)); }