Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- public class MergingHandler : handler<T> where T : Command {
- public Handle(T command) {
- var events = EventStore.GetEventsSinceVersion(command.AggregateId, command.ExpectedVersion);
- next.Handle(command);
- var potentialEvents = UnitOfWork.Current.Peek();
- foreach(Event e in events) {
- foreach(Event potential in potentialEvents) {
- if(ConflictManager.ConflictsWith(potential, e)) {
- throw new RealConcurrencyException();
- }
- }
- }
- }
- public void ConflictsWith(Event potential, Event e){
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement