Example #1
0
        public async Task <ActionResult <PagedTrainersDTO> > GetAllTrainers(
            [FromQuery] TrainerFilterData filterData,
            [FromQuery] string userId,
            [FromQuery] int pageNumber = 1,
            [FromQuery] int pageSize   = 3)
        {
            try
            {
                var result = await _trainerService.GetAllTrainers(pageNumber, pageSize, userId, filterData);

                return(Ok(result));
            }
            catch (Exception exception)
            {
                return(BadRequest(exception.Message));
            }
        }
Example #2
0
 public List <Trainer> GetTrainers()
 {
     return(_trainerService.GetAllTrainers());
 }
Example #3
0
        public async Task <ActionResult <List <Trainer> > > GetAll()
        {
            var result = await _trainersService.GetAllTrainers();

            return(Ok(result));
        }