public void Start() { foreach (var proj in Projections) { Store.SetEventHandler((msg, seq) => { var evt = new Model.PublishedEvent(msg, seq.Value); if (proj.Handles(evt)) { proj.Handle(evt); proj.SetState(seq.Value); } }); } }
public void Handle(PublishedEvent evt) { EventHandlers.Single(c => c.Handles(evt)).Handle(evt); }
public bool Handles(PublishedEvent evt) { return(EventHandlers.Any(c => c.Handles(evt))); }