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