Interface BehaviorContext<TSaga>
- Namespace
- MassTransit
- Assembly
- MassTransit.Abstractions.dll
A behavior context is an event context delivered to a behavior, including the state instance
public interface BehaviorContext<TSaga> : SagaConsumeContext<TSaga>, ConsumeContext, PipeContext, MessageContext, IPublishEndpoint, IPublishObserverConnector, ISendEndpointProvider, ISendObserverConnector where TSaga : class, ISaga
Type Parameters
TSaga
The state instance type
- Inherited Members
- Extension Methods
-
SchedulePublishExtensions.SchedulePublish(ConsumeContext, DateTime, object, Type, CancellationToken)SchedulePublishExtensions.SchedulePublish(ConsumeContext, TimeSpan, object, Type, CancellationToken)SendConsumeContextExecuteExtensions.Send(ConsumeContext, Uri, object, Type, Func<SendContext, Task>)
Properties
Event
Event Event { get; }
Property Value
Instance
[Obsolete("Deprecated, use Saga instead")]
TSaga Instance { get; }
Property Value
- TSaga
StateMachine
StateMachine<TSaga> StateMachine { get; }
Property Value
- StateMachine<TSaga>
Methods
CreateProxy(Event)
Return a proxy of the current behavior context with the specified event
BehaviorContext<TSaga> CreateProxy(Event @event)
Parameters
event
EventThe event for the new context
Returns
- BehaviorContext<TSaga>
CreateProxy<T>(Event<T>, T)
Return a proxy of the current behavior context with the specified event and data
BehaviorContext<TSaga, T> CreateProxy<T>(Event<T> @event, T data) where T : class
Parameters
event
Event<T>The event for the new context
data
TThe data for the event
Returns
- BehaviorContext<TSaga, T>
Type Parameters
T
The data type
Init<T>(object)
Task<SendTuple<T>> Init<T>(object values) where T : class
Parameters
values
object
Returns
Type Parameters
T
Raise(Event)
Raise an event on the current instance, pushing the current event on the stack
Task Raise(Event @event)
Parameters
event
EventThe event to raise
Returns
- Task
An awaitable Task
Raise<T>(Event<T>, T)
Raise an event on the current instance, pushing the current event on the stack
Task Raise<T>(Event<T> @event, T data) where T : class
Parameters
event
Event<T>The event to raise
data
TTHe event data
Returns
- Task
An awaitable Task
Type Parameters
T