public async Task <ActionResult> GetAllStudents() { var result = await _studentRepository.GetAllStudents(); if (result.StatusCode == Helpers.Success) { return(StatusCode(StatusCodes.Status200OK, result)); } else { return(StatusCode(StatusCodes.Status400BadRequest, result)); } }
public ActionResult <IEnumerable <Student> > GetAllStudents() { var studentItems = _repository.GetAllStudents(); return(Ok(_mapper.Map <IEnumerable <StudentReadDto> >(studentItems))); }
public async Task <IEnumerable <StudentEntity> > Get() { return(await _studentRepo.GetAllStudents()); }
public IActionResult Index() { List <Student> students = _repo.GetAllStudents().ToList(); return(View(students)); }