Class SagaInfo
Contains metadata and configuration information for a saga type, including handled events and saga lifecycle. This class manages the registration of event types that can start or continue a saga instance, providing runtime information for saga coordination and event routing.
public sealed class SagaInfo
- Inheritance
-
SagaInfo
- Inherited Members
- Extension Methods
Constructors
SagaInfo(Type, Type)
Contains metadata and configuration information for a saga type, including handled events and saga lifecycle. This class manages the registration of event types that can start or continue a saga instance, providing runtime information for saga coordination and event routing.
public SagaInfo(Type sagaType, Type stateType)
Parameters
sagaTypeTypeThe saga implementation type that handles business logic.
stateTypeTypeThe state type used for saga persistence and workflow tracking.
Properties
SagaType
Gets the saga implementation type that contains the business logic for processing events. This type must inherit from Saga<TState> and implement event handling methods.
public Type SagaType { get; }
Property Value
StateType
Gets the state type used for saga persistence and workflow tracking. This type must inherit from SagaState and contain all data needed for saga coordination.
public Type StateType { get; }
Property Value
Methods
GetHandledEvents()
Gets all event types that can be processed by this saga, including both start and continuation events.
public IEnumerable<Type> GetHandledEvents()
Returns
- IEnumerable<Type>
Collection of event types that the saga can handle.
HandlesEvent(Type)
Determines if the specified event type can be processed by this saga type. This includes both start events and continuation events for workflow processing.
public bool HandlesEvent(Type eventType)
Parameters
eventTypeTypeEvent type to check for saga handling capability.
Returns
- bool
True if the saga can process this event type; otherwise, false.
Handles<TEvent>()
Configures an event type as a saga continuation event that can be processed by existing saga instances. Handle events continue existing workflows without creating new saga state.
public SagaInfo Handles<TEvent>()
Returns
- SagaInfo
This SagaInfo instance for fluent configuration chaining.
Type Parameters
TEventEvent type that can be processed by existing saga instances.
IsStartEvent(Type)
Determines if the specified event type can initiate new saga instances. Start events create new saga state and begin workflow orchestration.
public bool IsStartEvent(Type eventType)
Parameters
eventTypeTypeEvent type to check for saga initiation capability.
Returns
- bool
True if the event can start new saga instances; otherwise, false.
StartsWith<TEvent>()
Configures an event type as a saga initiation event that can start new saga instances. Start events create new saga state and begin the workflow orchestration process.
public SagaInfo StartsWith<TEvent>()
Returns
- SagaInfo
This SagaInfo instance for fluent configuration chaining.
Type Parameters
TEventEvent type that can initiate new saga instances.