Class AsyncEvent<TData>
Base class for asynchronous events that carry strongly-typed business data.
public abstract class AsyncEvent<TData> : IAsyncEvent where TData : class, new()
Type Parameters
TDataThe type containing the event's business data.
- Inheritance
-
objectAsyncEvent<TData>
- Implements
- Derived
-
CompoundAsyncEvent<TData>
- Extension Methods
Remarks
This class provides the foundation for events that need to carry event-specific business data through the Data property. Use this base class for simple events that don't require cross-handler state sharing.
For compound events (before/after pairs) that need to share state between handlers, use CompoundAsyncEvent<TData> instead.
Constructors
AsyncEvent()
Initializes a new instance of the AsyncEvent<TData> class.
protected AsyncEvent()
Remarks
This constructor should be used only in testing scenarios.
AsyncEvent(TData)
Initializes a new instance of the AsyncEvent<TData> class with the specified properties.
protected AsyncEvent(TData data)
Parameters
dataTDataThe event's business data. Cannot be null.
Exceptions
- ArgumentNullException
Thrown when
datais null.
Properties
Data
Gets the event's business data.
public TData Data { get; }
Property Value
- TData
Remarks
Contains the data associated with the event.
The data may be read-only or mutable depending on the TData implementation.