Advertisement
Guest User

Untitled

a guest
Jul 28th, 2017
52
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 0.56 KB | None | 0 0
  1. public class MergingHandler : handler<T> where T : Command {
  2.  
  3.   public Handle(T command) {
  4.     var events = EventStore.GetEventsSinceVersion(command.AggregateId, command.ExpectedVersion);
  5.     next.Handle(command);
  6.     var potentialEvents = UnitOfWork.Current.Peek();
  7.     foreach(Event e in events) {
  8.       foreach(Event potential in potentialEvents) {
  9.         if(ConflictManager.ConflictsWith(potential, e)) {
  10.           throw new RealConcurrencyException();
  11.         }
  12.       }
  13.     }
  14.   }  
  15.  
  16.   public void ConflictsWith(Event potential, Event e){
  17.  
  18.   }
  19.  
  20. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement