Esempio n. 1
0
        public IActionResult GetStudentById(int id)
        {
            try
            {
                var student = _businessLogic.TryGetStudentById(id, out var message);
                if (student == null)
                {
                    return(BadRequest(message));
                }

                return(Ok(student));
            }
            catch (BLException e)
            {
                // Log here
                return(StatusCode(StatusCodes.Status500InternalServerError, e.Message));
            }
        }