Пример #1
0
        public async Task <IActionResult> GetProfessions()
        {
            var location = GetControllerActionNames();

            try
            {
                _logger.LogInfo($"{location}: Attempted Call");
                var professions = await _professionRepository.FindAll();

                var response = _mapper.Map <IList <ProfessionDTO> >(professions);
                _logger.LogInfo($"{location}: Successful");
                return(Ok(response));
            }
            catch (Exception e)
            {
                return(InternalError($"{location}: {e.Message} - {e.InnerException}"));
            }
        }