public async Task <JObject> Process(DomainEvent @event) { JObject result; using (var scope = new TransactionScope()) { using (var store = Initializtion.InitEventStore(this.connectionString)) { result = await @event.Process(); // Allows the entity to carry out processing requirements such as removing article from inventory var streamId = @event.Id; using (var stream = store.OpenStream(streamId, 0)) { stream.Add(new EventMessage { Body = JsonConvert.SerializeObject(@event) }); stream.CommitChanges(Guid.NewGuid()); } } scope.Complete(); } return(result); }
public void Process(DomainEvent e) { isActive = true; e.Process(); isActive = false; log.Add(e); }
public void Process(DomainEvent ev) { ev.Process(); Log.Add(ev); }