AggregateBase<TReadOnlySelf,TWritableSelf,TState>
The base class of an aggregate entity
public abstract class AggregateBase<TReadOnlySelf, TWritableSelf, TState> : EntityBase<TState>
where TReadOnlySelf : AggregateBase
where TWritableSelf : TReadOnlySelf
where TState : AggregateStateBase
Inheritance
- class EntityBase<TState>
Namespace
Parameters
Parameter | Description |
---|---|
TReadOnlySelf |
The Type of the read only aggregate entity |
TWritableSelf |
The Type of the writable aggregate entity |
TState |
The Type of the shared state of the aggregate entities |
Properties
IsNew
Gets a boolean flag to indicate whether the entity is new and therefore has not yet been persisted to the database
public bool IsNew { get; }
Methods
AsReadOnly
Converts the entity into it's read only counterpart
public virtual TReadOnlySelf AsReadOnly()
Returns
The read only entity
AsWritable
Converts the entity into it's writable counterpart
public virtual TWritableSelf AsWritable(IUnitOfWork uow)
Parameters
Parameter | Description |
---|---|
uow |
An active IUnitOfWork to use for write operations |
Returns
The writable entity