public async Task <IActionResult> Edit(int id, [Bind("ID,Email,ReportName")] EmailReportPair emailReportPair) { if (id != emailReportPair.ID) { return(NotFound()); } if (ModelState.IsValid) { try { _context.Update(emailReportPair); await _context.SaveChangesAsync(); } catch (DbUpdateConcurrencyException) { if (!EmailReportPairExists(emailReportPair.ID)) { return(NotFound()); } else { throw; } } return(RedirectToAction(nameof(Index))); } return(View(emailReportPair)); }
public async Task <IActionResult> Create([Bind("ID,Email,ReportName")] EmailReportPair emailReportPair) { if (ModelState.IsValid) { _context.Add(emailReportPair); await _context.SaveChangesAsync(); return(RedirectToAction(nameof(Index))); } return(View(emailReportPair)); }