public async Task <IActionResult> Edit(int id, [Bind("Id,MoodName")] ReportMood reportMood) { if (id != reportMood.Id) { return(NotFound()); } if (ModelState.IsValid) { try { _context.Update(reportMood); await _context.SaveChangesAsync(); } catch (DbUpdateConcurrencyException) { if (!ReportMoodExists(reportMood.Id)) { return(NotFound()); } else { throw; } } return(RedirectToAction(nameof(Index))); } return(View(reportMood)); }
public async Task <IActionResult> Create([Bind("Id,MoodName")] ReportMood reportMood) { if (ModelState.IsValid) { _context.Add(reportMood); await _context.SaveChangesAsync(); return(RedirectToAction(nameof(Index))); } return(View(reportMood)); }