Interface IEventSourced
Represents an identifiable entity that is event sourced.
Namespace: IRM.Domain.Persistance
Assembly: IRM.dll
Syntax
public interface IEventSourced
Properties
Id
Gets the entity identifier.
Declaration
Guid Id { get; }
Property Value
System.Guid
|
Version
Gets or sets the aggregate's version. As the aggregate is being updated and events being generated, the version is incremented.
Declaration
int Version { get; set; }
Property Value
System.Int32
|
Methods
ClearUncommittedEvents()
Clears the collection of uncommited events.
Declaration
void ClearUncommittedEvents()
Remarks
After this method is called the GetUncommittedEvents() should return an empty collection.
GetUncommittedEvents()
Gets all newly produced events from the object that should be stored in the event source.
Declaration
IEnumerable<IEvent> GetUncommittedEvents()
Returns
IEnumerable<IEvent>
A collection of IEvent to store in the event source. |
LoadFromEvents(IEnumerable<IEvent>)
Recreates an event sourced object from the events.
Declaration
void LoadFromEvents(IEnumerable<IEvent> events)
Parameters
IEnumerable<IEvent>
events
A collection of IEvent to recreate the object from. |