Example #1
0
        public async Task <IActionResult> ImportInitialDataAsync()
        {
            try
            {
                var response = await _optionsService.ImportInitialDataAsync();

                return(response.StatusCode == StatusCodes.Status200OK
                    ? Ok(response.Result)
                    : StatusCode(response.StatusCode, response.Errors));
            }
            catch (Exception ex)
            {
                _logger.LogError(ex, string.Empty);

                return(StatusCode(StatusCodes.Status500InternalServerError,
                                  ErrorViewModel.Factory.NewErrorFromException(ex)));
            }
        }