public async Task <IActionResult> Edit(int id, [Bind("ID,name,yearsexperience,ASTACertified,Specialties,PlacesVisited,email,DateCreated,DateLastModified")] TravelAgentParameters travelAgentParameters) { if (id != travelAgentParameters.ID) { return(NotFound()); } if (ModelState.IsValid) { try { _context.Update(travelAgentParameters); await _context.SaveChangesAsync(); } catch (DbUpdateConcurrencyException) { if (!TravelAgentParametersExists(travelAgentParameters.ID)) { return(NotFound()); } else { throw; } } return(RedirectToAction(nameof(Index))); } return(View(travelAgentParameters)); }
public async Task <IActionResult> Create([Bind("ID,name,yearsexperience,ASTACertified,Specialties,PlacesVisited,email,DateCreated,DateLastModified")] TravelAgentParameters travelAgentParameters) { if (ModelState.IsValid) { _context.Add(travelAgentParameters); await _context.SaveChangesAsync(); return(RedirectToAction(nameof(Index))); } return(View(travelAgentParameters)); }