public async Task <IActionResult> Edit(long id, [Bind("Id,Stat_Name")] Stat_type stat_type) { if (id != stat_type.Id) { return(NotFound()); } if (ModelState.IsValid) { try { _context.Update(stat_type); await _context.SaveChangesAsync(); } catch (DbUpdateConcurrencyException) { if (!Stat_typeExists(stat_type.Id)) { return(NotFound()); } else { throw; } } return(RedirectToAction(nameof(Index))); } return(View(stat_type)); }
public async Task <IActionResult> Create([Bind("Id,Stat_Name")] Stat_type stat_type) { if (ModelState.IsValid) { _context.Add(stat_type); await _context.SaveChangesAsync(); return(RedirectToAction(nameof(Index))); } return(View(stat_type)); }