/// <summary> /// Creates a <see cref="IOutgoingLogicalMessageContext" /> based on the current context. /// </summary> public static IOutgoingLogicalMessageContext CreateOutgoingLogicalMessageContext(this StageConnector <IOutgoingReplyContext, IOutgoingLogicalMessageContext> stageConnector, OutgoingLogicalMessage outgoingMessage, IReadOnlyCollection <RoutingStrategy> routingStrategies, IOutgoingReplyContext sourceContext) { Guard.AgainstNull(nameof(outgoingMessage), outgoingMessage); Guard.AgainstNull(nameof(routingStrategies), routingStrategies); Guard.AgainstNull(nameof(sourceContext), sourceContext); return(new OutgoingLogicalMessageContext( sourceContext.MessageId, sourceContext.Headers, outgoingMessage, routingStrategies, sourceContext)); }
/// <summary> /// Turns off the best practice enforcement for the given context. /// </summary> public static void DoNotEnforceBestPractices(this IOutgoingReplyContext context) { context.Extensions.SetDoNotEnforceBestPractices(); }
/// <summary> /// Returns the incoming physical message if there is one currently processed. /// </summary> public static bool TryGetIncomingPhysicalMessage(this IOutgoingReplyContext context, out IncomingMessage message) { Guard.AgainstNull(nameof(context), context); return(context.Extensions.TryGet(out message)); }
/// <summary> /// Turns off the best practice enforcement for the given context. /// </summary> public static void DoNotEnforceBestPractices(this IOutgoingReplyContext context) { Guard.AgainstNull(nameof(context), context); context.Extensions.SetDoNotEnforceBestPractices(); }
/// <summary> /// Creates a <see cref="IOutgoingLogicalMessageContext" /> based on the current context. /// </summary> public static IOutgoingLogicalMessageContext CreateOutgoingLogicalMessageContext(this StageConnector<IOutgoingReplyContext, IOutgoingLogicalMessageContext> stageConnector, OutgoingLogicalMessage outgoingMessage, IReadOnlyCollection<RoutingStrategy> routingStrategies, IOutgoingReplyContext sourceContext) { Guard.AgainstNull(nameof(outgoingMessage), outgoingMessage); Guard.AgainstNull(nameof(routingStrategies), routingStrategies); Guard.AgainstNull(nameof(sourceContext), sourceContext); return new OutgoingLogicalMessageContext( sourceContext.MessageId, sourceContext.Headers, outgoingMessage, routingStrategies, sourceContext); }