Class SendContextScope
- Namespace
- MassTransit.Context
- Assembly
- MassTransit.Abstractions.dll
public class SendContextScope : SendContextProxy
- Inheritance
-
SendContextScope
- Derived
- Inherited Members
Constructors
SendContextScope(SendContext)
public SendContextScope(SendContext context)
Parameters
context
SendContext
SendContextScope(SendContext, params object[])
public SendContextScope(SendContext context, params object[] payloads)
Parameters
context
SendContextpayloads
object[]
Properties
CancellationToken
Returns the CancellationToken for the context (implicit interface)
public override CancellationToken CancellationToken { get; }
Property Value
Methods
AddOrUpdatePayload<T>(PayloadFactory<T>, UpdatePayloadFactory<T>)
Either adds a new payload, or updates an existing payload
public override T AddOrUpdatePayload<T>(PayloadFactory<T> addFactory, UpdatePayloadFactory<T> updateFactory) where T : class
Parameters
addFactory
PayloadFactory<T>The payload factory called if the payload is not present
updateFactory
UpdatePayloadFactory<T>The payload factory called if the payload already exists
Returns
- T
Type Parameters
T
The payload type
GetOrAddPayload<T>(PayloadFactory<T>)
Get or add a payload to the context, using the provided payload factory.
public override T GetOrAddPayload<T>(PayloadFactory<T> payloadFactory) where T : class
Parameters
payloadFactory
PayloadFactory<T>The payload factory, which is only invoked if the payload is not present.
Returns
- T
Type Parameters
T
The payload type
HasPayloadType(Type)
Returns true if the payload type is included with or supported by the context type
public override bool HasPayloadType(Type payloadType)
Parameters
payloadType
Type
Returns
TryGetPayload<T>(out T?)
Attempts to get the specified payload type
public override bool TryGetPayload<T>(out T? payload) where T : class
Parameters
payload
T
Returns
Type Parameters
T