Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- public abstract class Aggregate
- {
- private readonly List<Event> newEvents = new List<Event>();
- public Guid Id { get; protected set; }
- public IEnumerable<Event> NewEvents => this.newEvents.AsReadOnly();
- public void Replay(List<Event> events)
- {
- foreach (var @event in events)
- Play(@event);
- }
- protected void Emit(Event @event) { ... }
- private void Play(Event @event) {... }
- }
Add Comment
Please, Sign In to add comment