Esempio n. 1
0
        /// <summary>
        /// Gets (most likely from a cache) the set of correlation properties relevant for the given saga handler.
        /// </summary>
        public SagaDataCorrelationProperties GetCorrelationProperties(object message, Saga saga)
        {
            var sagaType     = saga.GetType();
            var sagaDataType = saga.GetSagaDataType();
            var key          = $"{sagaType.FullName}/{sagaDataType.FullName}";

            var correlationPropertiesForThisSagaDataType = _cachedCorrelationProperties
                                                           .GetOrAdd(key, _ => GetCorrelationProperties(saga));

            return(new SagaDataCorrelationProperties(correlationPropertiesForThisSagaDataType, sagaDataType));
        }