public async Task <IActionResult> PutBugReport(int id, BugReport bugReport) { if (id != bugReport.Id) { return(BadRequest()); } _context.Entry(bugReport).State = EntityState.Modified; try { await _context.SaveChangesAsync(); } catch (DbUpdateConcurrencyException) { if (!BugReportExists(id)) { return(NotFound()); } else { throw; } } return(NoContent()); }
public async Task <IActionResult> Create([Bind("Id,BugName,DateOpen,BugDescription,IsClosed,BugResolution")] Bug bug) { if (ModelState.IsValid) { _context.Add(bug); await _context.SaveChangesAsync(); return(RedirectToAction(nameof(Index))); } return(View(bug)); }