Beispiel #1
0
 public async Task HandleAsync(CompanyStockCreatedEvent @event)
 {
     await _projectionWriter.UpdateAsync <CompanyProjection>(@event.AggregateId, projection =>
     {
         projection.StockCode     = @event.Code;
         projection.StockQuantity = @event.Quantity;
         projection.StockUnit     = @event.Unit;
     });
 }
Beispiel #2
0
 public async Task HandleAsync(WalletCreatedEvent @event)
 {
     await _projectionWriter.UpdateAsync <InvestorProjection>(@event.InvestorId,
                                                              e => e.WalletId = @event.AggregateId);
 }
 public async Task HandleAsync(BuyOrderCancelledEvent @event)
 {
     await _projectionWriter.UpdateAsync <BuyOrderProjection>(@event.AggregateId,
                                                              e => { e.State = OrderState.Cancelled; });
 }
 public async Task HandleAsync(WalletChargeRollbackedEvent @event)
 {
     await _projectionWriter.UpdateAsync <WalletProjection>(@event.AggregateId, e => e.Amount += @event.Amount);
 }
Beispiel #5
0
 public async Task HandleAsync(SellOrderFinishedEvent @event)
 {
     await _projectionWriter.UpdateAsync <SellOrderProjection>(@event.AggregateId,
                                                               e => { e.State = OrderState.Finished; });
 }