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