Exemplo n.º 1
0
        public async Task <ActionResult <TrainerDTO> > GetTrainerByUser(string userId)
        {
            try
            {
                var trainer = await _trainerService.GetTrainerByUser(userId);

                return(Ok(trainer));
            }
            catch (ArgumentNullException exception)
            {
                return(NotFound(exception.Message));
            }
            catch (Exception exception)
            {
                return(BadRequest(exception.Message));
            }
        }