Пример #1
0
        public async Task <IActionResult> EditUniversityAsync([FromBody] UnivesityModelRequest request)
        {
            if (!ModelState.IsValid)
            {
                return(BadRequest());
            }

            try
            {
                var result = await _universityService.EditUniversityTask(request);

                return(StatusCode(200, result));
            }
            catch (UniversityNotFoundException ex)
            {
                return(StatusCode(404, ex.Message));
            }
            catch (Exception ex)
            {
                _logger.Error(ex);
                return(StatusCode(500, "Internal server error"));
            }
        }