Guest User

Untitled

a guest
Oct 24th, 2017
72
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.42 KB | None | 0 0
  1. public abstract class Aggregate
  2. {
  3. private readonly List<Event> newEvents = new List<Event>();
  4. public Guid Id { get; protected set; }
  5. public IEnumerable<Event> NewEvents => this.newEvents.AsReadOnly();
  6.  
  7. public void Replay(List<Event> events)
  8. {
  9. foreach (var @event in events)
  10. Play(@event);
  11. }
  12.  
  13. protected void Emit(Event @event) { ... }
  14.  
  15. private void Play(Event @event) {... }
  16. }
Add Comment
Please, Sign In to add comment