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
contextSendContext
SendContextScope(SendContext, params object[])
public SendContextScope(SendContext context, params object[] payloads)
  Parameters
contextSendContextpayloadsobject[]
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
addFactoryPayloadFactory<T>The payload factory called if the payload is not present
updateFactoryUpdatePayloadFactory<T>The payload factory called if the payload already exists
Returns
- T
 
Type Parameters
TThe 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
payloadFactoryPayloadFactory<T>The payload factory, which is only invoked if the payload is not present.
Returns
- T
 
Type Parameters
TThe 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
payloadTypeType
Returns
TryGetPayload<T>(out T?)
Attempts to get the specified payload type
public override bool TryGetPayload<T>(out T? payload) where T : class
  Parameters
payloadT
Returns
Type Parameters
T