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