Esempio n. 1
0
            public RegisterStep(
                PartitionKeyExtractor partitionKeyExtractor, ContainerInformationExtractor containerInformationExtractor) :
                base(nameof(TransactionInformationBeforeThePhysicalOutboxBehavior),
                     typeof(TransactionInformationBeforeThePhysicalOutboxBehavior),
                     "Populates the transaction information before the physical outbox.",
                     b =>
            {
                var partitionKeyFromHeadersExtractors = b.GetServices <IPartitionKeyFromHeadersExtractor>();
                foreach (var extractor in partitionKeyFromHeadersExtractors)
                {
                    partitionKeyExtractor.ExtractPartitionKeyFromHeaders(extractor);
                }

                var containerInformationFromHeadersExtractors = b.GetServices <IContainerInformationFromHeadersExtractor>();
                foreach (var extractor in containerInformationFromHeadersExtractors)
                {
                    containerInformationExtractor.ExtractContainerInformationFromHeaders(extractor);
                }
                return(new TransactionInformationBeforeThePhysicalOutboxBehavior(partitionKeyExtractor, containerInformationExtractor));
            })
            {
            }
Esempio n. 2
0
 /// <summary>
 /// Adds an extraction rule that extracts the partition key from headers.
 /// </summary>
 /// <param name="extractor">The extractor function to extract the header value.</param>
 /// <param name="extractorArgument">The argument passed as state to the <paramref name="extractor"/></param>
 /// <typeparam name="TArg">The extractor argument type.</typeparam>
 /// <remarks>Explicitly added extractors and extraction rules are executed before extractors registered on the container.</remarks>
 public void ExtractPartitionKeyFromHeaders <TArg>(Func <IReadOnlyDictionary <string, string>, TArg, PartitionKey?> extractor, TArg extractorArgument) =>
 PartitionKeyExtractor.ExtractPartitionKeyFromHeaders(extractor, extractorArgument);
Esempio n. 3
0
 /// <summary>
 /// Adds an extraction rule that extracts the partition key from headers.
 /// </summary>
 /// <param name="extractor">The extractor function to extract the header value.</param>
 /// <remarks>Explicitly added extractors and extraction rules are executed before extractors registered on the container.</remarks>
 public void ExtractPartitionKeyFromHeaders(Func <IReadOnlyDictionary <string, string>, PartitionKey?> extractor) =>
 PartitionKeyExtractor.ExtractPartitionKeyFromHeaders(extractor);
Esempio n. 4
0
 /// <summary>
 /// Adds an instance of <see cref="IPartitionKeyFromHeadersExtractor"/> to the list of header extractors.
 /// </summary>
 /// <param name="extractor">The custom extractor.</param>
 /// <remarks>Explicitly added extractors and extraction rules are executed before extractors registered on the container.</remarks>
 public void ExtractPartitionKeyFromHeaders(IPartitionKeyFromHeadersExtractor extractor) => PartitionKeyExtractor.ExtractPartitionKeyFromHeaders(extractor);