Exemplo n.º 1
0
        public IActionResult getByStudentByType(string studentType)
        {
            if (string.IsNullOrWhiteSpace(studentType))
            {
                return(BadRequest(this.responseHandler.getAppCustomErrorResponse("Invalid student type")));
            }

            try
            {
                return(Ok(_estudianteApplicationService.getByStudentType(studentType)));
            }
            catch (ArgumentException ex) {
                return(BadRequest(this.responseHandler.getAppCustomErrorResponse(ex.Message)));
            }
            catch (Exception)
            {
                return(StatusCode(StatusCodes.Status500InternalServerError, this.responseHandler.getAppExceptionResponse()));
            }
        }
Exemplo n.º 2
0
        public List <EstudianteDTO> getByStudentByType(string studentType)
        {
            if (string.IsNullOrWhiteSpace(studentType))
            {
                return(null);
            }

            try
            {
                return(_estudianteApplicationService.getByStudentType(studentType));
            }
            catch (ArgumentException ex) {
                return(null);
            }
            catch (Exception ex)
            {
                return(null);
            }
        }