Aggregate<TKey, TEvent> Class
Definition
Represents the base class from which all implementations of an Aggregate Root (as specified in Domain Driven Design) should derive.
public abstract class Aggregate<TKey, TEvent> : Entity<TKey>, IEntity<TKey>, IIdentity<TKey>, IMetadata
Type Parameters
TKeyThe type of the key that uniquely identifies this aggregate.
TEventThe type of the event that implements the IDomainEvent interface.
- Inheritance
-
Entity<TKey>Aggregate<TKey, TEvent>
- Derived
- Inherited Members
- Extension Methods
Constructors
| Name | Description |
|---|---|
| Aggregate(IMetadata) | Initializes a new instance of the Aggregate<TKey, TEvent> class. |
| Aggregate(TKey) | Initializes a new instance of the Aggregate<TKey, TEvent> class. |
Properties
| Name | Description |
|---|---|
| Events | Gets the events that was added to the Aggregate. |
| Metadata | Gets the associated metadata of this Aggregate. |
Methods
| Name | Description |
|---|---|
| AddEvent(TEvent) | Adds an event to the Aggregate. |
| RemoveAllEvents() | Removes all events from the Aggregate. |
See Also
Entity<TKey>