public async Task <IActionResult> Edit(int id, [Bind("Id,Resource,TopicCovered,ApplicableClasses,ResourceLink")] CodingResource codingResource) { if (id != codingResource.Id) { return(NotFound()); } if (ModelState.IsValid) { try { _context.Update(codingResource); await _context.SaveChangesAsync(); } catch (DbUpdateConcurrencyException) { if (!CodingResourceExists(codingResource.Id)) { return(NotFound()); } else { throw; } } return(RedirectToAction(nameof(Index))); } return(View(codingResource)); }
public async Task <IActionResult> Create([Bind("Id,Resource,TopicCovered,ApplicableClasses,ResourceLink")] CodingResource codingResource) { if (ModelState.IsValid) { _context.Add(codingResource); await _context.SaveChangesAsync(); return(RedirectToAction(nameof(Index))); } return(View(codingResource)); }