Exemplo n.º 1
0
 public async Task SaveAsync(OrderReadModel model)
 {
     await _store.SaveAsync(model);
 }
Exemplo n.º 2
0
 public async Task HandleAsync(OrderCreated @event)
 {
     var oderItems = @event.Items.Select(item => new OrderItemReadModel(item.ProductId, item.Price, item.Quantity));
     var model     = new OrderReadModel(@event.AggregateId, @event.CustomerId, oderItems);
     await _repository.SaveAsync(model);
 }