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)); }) { }
/// <summary> /// Adds an extraction rule that extracts the container information from the message headers. /// </summary> /// <param name="extractor">The extraction function.</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 ExtractContainerInformationFromHeaders <TArg>(Func <IReadOnlyDictionary <string, string>, TArg, ContainerInformation?> extractor, TArg extractorArgument) => ContainerInformationExtractor.ExtractContainerInformationFromHeaders(extractor, extractorArgument);
/// <summary> /// Adds an instance of <see cref="IContainerInformationFromHeadersExtractor"/> 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 ExtractContainerInformationFromHeaders(IContainerInformationFromHeadersExtractor extractor) => ContainerInformationExtractor.ExtractContainerInformationFromHeaders(extractor);
/// <summary> /// Adds an extraction rule that extracts the container information from the message headers. /// </summary> /// <param name="extractor">The extraction function.</param> /// <remarks>Explicitly added extractors and extraction rules are executed before extractors registered on the container.</remarks> public void ExtractContainerInformationFromHeaders(Func <IReadOnlyDictionary <string, string>, ContainerInformation?> extractor) => ContainerInformationExtractor.ExtractContainerInformationFromHeaders(extractor);