public async Task <IActionResult> Edit(int id, [Bind("EcoScoreId,Material,Removal,Reuse")] EcoScoreTally ecoScoreTally) { if (id != ecoScoreTally.EcoScoreId) { return(NotFound()); } if (ModelState.IsValid) { try { _context.Update(ecoScoreTally); await _context.SaveChangesAsync(); } catch (DbUpdateConcurrencyException) { if (!EcoScoreTallyExists(ecoScoreTally.EcoScoreId)) { return(NotFound()); } else { throw; } } return(RedirectToAction(nameof(Index))); } return(View(ecoScoreTally)); }
public async Task <IActionResult> Create([Bind("EcoScoreId,Material,Removal,Reuse")] EcoScoreTally ecoScoreTally) { if (ModelState.IsValid) { _context.Add(ecoScoreTally); await _context.SaveChangesAsync(); return(RedirectToAction(nameof(Index))); } return(View(ecoScoreTally)); }