示例#1
0
        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()));
 }
示例#3
0
 public async Task <IActionResult> Index([FromServices] IStudentGenerator studentGenerator)
 {
     return(View(await studentGenerator.GetStudentsModel()));
 }