public async Task <IActionResult> DeleteStudent(int id) { var service = HttpContext.RequestServices.GetService <IStudentService>(); await service.RemoveStudent(id); return(View("Index", await _studentGenerator.GetStudentsModel())); }
public async Task <IActionResult> Index() { return(View(await _studentGenerator.GetStudentsModel())); }
public async Task <IActionResult> Index([FromServices] IStudentGenerator studentGenerator) { return(View(await studentGenerator.GetStudentsModel())); }