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