Пример #1
0
        /// <summary>
        /// Gets the saga metadata for this saga instance.
        /// </summary>
        /// <remarks>Called once during saga discovery.</remarks>
        internal SagaMetadata GetMetadata()
        {
            Type         sagaType = GetType();
            SagaMetadata sagaMetadata;

            if (!SagaMetadataCache.TryGetValue(sagaType, out sagaMetadata))
            {
                var configuration = new SagaConfiguration(GetType());

                Configure(configuration);
                SagaMetadataCache[sagaType] = sagaMetadata = configuration.GetMetadata();
            }

            return(sagaMetadata);
        }
Пример #2
0
 /// <summary>
 /// Configure the saga event handling for this saga type.
 /// </summary>
 /// <param name="saga">The saga configuration instance used to collect saga metadata.</param>
 protected abstract void Configure(SagaConfiguration saga);