Interface State<TSaga>
- Namespace
- MassTransit
- Assembly
- MassTransit.Abstractions.dll
A state within a state machine that can be targeted with events
public interface State<TSaga> : State, IVisitable, IProbeSite, IComparable<State> where TSaga : class, ISaga
Type Parameters
TSaga
The instance type to which the state applies
- Inherited Members
Properties
Events
IEnumerable<Event> Events { get; }
Property Value
SuperState
Returns the superState of the state, if there is one
State<TSaga> SuperState { get; }
Property Value
- State<TSaga>
Methods
AddSubstate(State<TSaga>)
Adds a substate to the state
void AddSubstate(State<TSaga> subState)
Parameters
subState
State<TSaga>
Bind(Event, IStateMachineActivity<TSaga>)
Bind an activity to an event
void Bind(Event @event, IStateMachineActivity<TSaga> activity)
Parameters
event
Eventactivity
IStateMachineActivity<TSaga>
HasState(State<TSaga>)
True if the specified state is included in the state
bool HasState(State<TSaga> state)
Parameters
state
State<TSaga>
Returns
Ignore(Event)
Ignore the specified event in this state. Prevents an exception from being thrown if the event is raised during this state.
void Ignore(Event @event)
Parameters
event
Event
Ignore<T>(Event<T>, StateMachineCondition<TSaga, T>)
Ignore the specified event in this state if the filter condition passed. Prevents exceptions from being thrown if the event is raised during this state.
void Ignore<T>(Event<T> @event, StateMachineCondition<TSaga, T> filter) where T : class
Parameters
event
Event<T>filter
StateMachineCondition<TSaga, T>
Type Parameters
T
IsStateOf(State<TSaga>)
True if the specified state is a substate of the current state
bool IsStateOf(State<TSaga> state)
Parameters
state
State<TSaga>
Returns
Raise(BehaviorContext<TSaga>)
Task Raise(BehaviorContext<TSaga> context)
Parameters
context
BehaviorContext<TSaga>
Returns
Raise<T>(BehaviorContext<TSaga, T>)
Raise an event to the state, passing the instance
Task Raise<T>(BehaviorContext<TSaga, T> context) where T : class
Parameters
context
BehaviorContext<TSaga, T>The event context
Returns
Type Parameters
T
The event data type