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