public async Task <IActionResult> Edit(int id, [Bind("ID,Overall,Apartment,NoviceOwners,Sensitivity,Alone,ColdWeather,HotWeather")] Adaptibility adaptibility) { if (id != adaptibility.ID) { return(NotFound()); } if (ModelState.IsValid) { try { _context.Update(adaptibility); await _context.SaveChangesAsync(); } catch (DbUpdateConcurrencyException) { if (!AdaptibilityExists(adaptibility.ID)) { return(NotFound()); } else { throw; } } return(RedirectToAction(nameof(Index))); } return(View(adaptibility)); }
public async Task <IActionResult> Create([Bind("ID,Overall,Apartment,NoviceOwners,Sensitivity,Alone,ColdWeather,HotWeather")] Adaptibility adaptibility) { if (ModelState.IsValid) { _context.Add(adaptibility); await _context.SaveChangesAsync(); return(RedirectToAction(nameof(Index))); } return(View(adaptibility)); }