Esempio n. 1
0
        /// <summary>
        /// Получить дерево индексов по идентификатору типа карточки инцидента
        /// </summary>
        public async Task <Result <IndexesDto> > GetIndexTreeByCaseTypeId(Guid caseTypeId)
        {
            Result <IndexTreeClientDto> result = await _indexServiceClient.GetIndexesByCaseTypeId(caseTypeId);

            if (result.IsFailure)
            {
                _logger.Warning($"Error getting index tree from IndexService. caseTypeId: {caseTypeId}. {result.ErrorMessage}");
                return(Result.Failure <IndexesDto>(ErrorCodes.UnableToGetIndex));
            }

            var indexesDto = _mapper.Map <IndexesDto>(result.Value);

            return(Result.Success(indexesDto));
        }