Table of Contents

Struct Response<T1, T2>

Namespace
MassTransit
Assembly
MassTransit.Abstractions.dll

The response for a request that accepts two response types, which can be matched easily or converted back into a tuple of tasks.

public readonly struct Response<T1, T2> : Response, MessageContext where T1 : class where T2 : class

Type Parameters

T1
T2
Implements
Inherited Members
Extension Methods

Constructors

Response(Task<Response<T1>>, Task<Response<T2>>)

public Response(Task<Response<T1>> response1, Task<Response<T2>> response2)

Parameters

response1 Task<Response<T1>>
response2 Task<Response<T2>>

Properties

ConversationId

The conversationId of the message, which is copied and carried throughout the message flow by the infrastructure.

public Guid? ConversationId { get; }

Property Value

Guid?

CorrelationId

If the message implements the CorrelatedBy(Guid) interface, this field should be populated by default to match that value. It can, of course, be overwritten with something else.

public Guid? CorrelationId { get; }

Property Value

Guid?

DestinationAddress

The destination address of the message

public Uri? DestinationAddress { get; }

Property Value

Uri

ExpirationTime

The expiration time of the message if it is not intended to last forever.

public DateTime? ExpirationTime { get; }

Property Value

DateTime?

FaultAddress

The fault address to which fault events should be sent if the message consumer faults

public Uri? FaultAddress { get; }

Property Value

Uri

Headers

Additional application-specific headers that are added to the message by the application or by features within MassTransit, such as when a message is moved to an error queue.

public Headers Headers { get; }

Property Value

Headers

Host

The host information of the message producer. This may not be present if the message was sent from an earlier version of MassTransit.

public HostInfo Host { get; }

Property Value

HostInfo

InitiatorId

If this message was produced within the context of a previous message, the CorrelationId of the message is contained in this property. If the message was produced from a saga instance, the CorrelationId of the saga is used.

public Guid? InitiatorId { get; }

Property Value

Guid?

Message

public object Message { get; }

Property Value

object

MessageId

The messageId assigned to the message when it was initially Sent. This is different than the transport MessageId, which is only for the Transport.

public Guid? MessageId { get; }

Property Value

Guid?

RequestId

If the message is a request, or related to a request, such as a response or a fault, this contains the requestId.

public Guid? RequestId { get; }

Property Value

Guid?

ResponseAddress

The response address to which responses to the request should be sent

public Uri? ResponseAddress { get; }

Property Value

Uri

SentTime

When the message was originally sent

public DateTime? SentTime { get; }

Property Value

DateTime?

SourceAddress

The address of the message producer that sent the message

public Uri? SourceAddress { get; }

Property Value

Uri

Methods

Deconstruct(out Task<Response<T1>>, out Task<Response<T2>>)

public void Deconstruct(out Task<Response<T1>> r1, out Task<Response<T2>> r2)

Parameters

r1 Task<Response<T1>>
r2 Task<Response<T2>>

Is(out Response<T1>?)

public bool Is(out Response<T1>? result)

Parameters

result Response<T1>

Returns

bool

Is(out Response<T2>?)

public bool Is(out Response<T2>? result)

Parameters

result Response<T2>

Returns

bool

Is<T>(out Response<T>?)

public bool Is<T>(out Response<T>? result) where T : class

Parameters

result Response<T>

Returns

bool

Type Parameters

T

Operators

implicit operator Response<T1, T2>((Task<Response<T1>> response1, Task<Response<T2>> response2))

public static implicit operator Response<T1, T2>((Task<Response<T1>> response1, Task<Response<T2>> response2) source)

Parameters

source (Task<Response<T1>> response1, Task<Response<T2>> response2)

Returns

Response<T1, T2>