public Task Apply(CustomerRenamed @event)
 {
     return(UpdateByStreamnameAsync <CustomerOverviewViewModel>(@event.Id,
                                                                customer =>
     {
         customer.Name = @event.NewName;
     }));
 }
Exemplo n.º 2
0
        public void Handle(CustomerRenamed @event)
        {
            var documentStore = documentStoreFactory();
            var customer      = documentStore.Get <CustomerDocument>(@event.SourceId.ToString());

            customer.Name = @event.NewName;

            documentStoreFactory().InsertOrReplace(customer);
        }
Exemplo n.º 3
0
 public async Task HandleAsync(CustomerRenamed message, CancellationToken cancellationToken = default)
 {
     Console.WriteLine("Customer Renamed");
 }
Exemplo n.º 4
0
 private void Apply(CustomerRenamed @event)
 {
     _state.Name = new CustomerName(@event.NewName);
 }