コード例 #1
0
        /// <summary>
        /// Converts a given <paramref name="message"/> to the type of a <typeparamref name="TTargetMessage"/>.
        /// </summary>
        /// <param name="message">The message to convert.</param>
        private TTargetMessage ConvertToTargetMessage(TMessage message)
        {
            _logger.LogDebug($"Starting conversion from message type '{typeof(TMessage)}' to '{typeof(TTargetMessage)}' with '{_messageConverter.GetType()}'.");
            var convertedMessage = _messageConverter.ConvertToTargetMessage(message);

            _logger.LogDebug($"Message converted to '{typeof(TTargetMessage)}': '{convertedMessage}'.");
            _logger.LogDebug($"Ended conversion from message type '{typeof(TMessage)}' to '{typeof(TTargetMessage)}' with '{_messageConverter.GetType()}'.");
            return(convertedMessage);
        }