Table of Contents

Aggregate<TKey, TEvent> Class

Definition

Namespace
Savvyio.Domain
Assemblies
Savvyio.Domain.dll
Source
src/Savvyio.Domain/Aggregate.cs

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

TKey

The type of the key that uniquely identifies this aggregate.

TEvent

The type of the event that implements the IDomainEvent interface.

Inheritance
Entity<TKey>
Aggregate<TKey, TEvent>
Implements
IEntity<TKey>
IIdentity<TKey>
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>