-
Notifications
You must be signed in to change notification settings - Fork 2
Events
Kevin Le Jeune edited this page Sep 8, 2016
·
1 revision
Events represent a system modification.
An event is a class inheriting from IEvent<>
. It contains:
- basic type parameters
- a method which should call a method on an aggregate.
Example:
public class DummyModificationEvent : IEvent<DummyAggregate>
{
public string Value { get; set; }
public void Apply(DummyAggregate aggregate, IEventInformation information)
{
aggregate.Modify(information.Type(this));
}
public string AggregateId { get; set; }
}
An event represent something that already happened. An aggregate cannot refuse an event, and an event must call an aggregate method.