/// <summary>
 /// Handle ProductRegisteredEvent.
 /// </summary>
 /// <param name="productRegisteredEvent">ProductRegisteredEvent instance.</param>
 /// <param name="cancellationToken">Cancellation token.</param>
 /// <returns>Asynchronous task which can be awaited for completion.</returns>
 public Task HandleProductRegisteredEventAsync(ProductRegisteredEvent productRegisteredEvent, CancellationToken cancellationToken)
 {
     // Add product to read-side repository if event is received.
     return(_productReadSideRepository.AddProductAsync(new ProductReadModel()
     {
         ProductId = productRegisteredEvent.ProductId,
         ProductName = productRegisteredEvent.ProductName
     }));
 }
示例#2
0
 private Product(ProductRegisteredEvent @event)
 => ApplyChange <Product>(@event);
示例#3
0
 private void OnProductRegisteredEvent(ProductRegisteredEvent domainEvent)
 {
     Name = domainEvent.ProductName;
 }