示例#1
0
        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)));
        }
示例#3
0
 public async Task <IEnumerable <StudentEntity> > Get()
 {
     return(await _studentRepo.GetAllStudents());
 }
示例#4
0
        public IActionResult Index()
        {
            List <Student> students = _repo.GetAllStudents().ToList();

            return(View(students));
        }