public async Task <ActionResult> Edit(NewStudentInfo nc) { if (ModelState.IsValid) { _db.Update(nc); await _db.SaveChangesAsync(); return(View("Index")); } return(View(nc)); }
public async Task <IActionResult> Create(NewStudentInfo nec) { if (ModelState.IsValid) { _db.Add(nec); await _db.SaveChangesAsync(); return(RedirectToAction("Index")); } return(View(nec)); }