public void Consume(CustomerCreatedEvent @event)
 {
     using (var session = _documentStore.OpenSession())
     {
         var dto = session.Load <CustomerHasLivedInDto>(Dto.GetDtoIdOf <CustomerHasLivedInDto>(@event.AggregateId));
         dto.AddCity(@event.City);
         session.SaveChanges();
     }
 }
示例#2
0
 public void Consume(Relocated @event)
 {
     using (var session = _DocumentStore.OpenSession())
     {
         var dto = session.Load <CustomerListDto>(Dto.GetDtoIdOf <CustomerListDto>(@event.AggregateId));
         dto.City = @event.City;
         session.SaveChanges();
     }
 }
 public void Consume(Relocated @event)
 {
     using (var session = _documentStore.OpenSession())
     {
         var dto = session.Load <CustomerAddressDto>(Dto.GetDtoIdOf <CustomerAddressDto>(@event.AggregateId));
         dto.Street       = @event.Street;
         dto.StreetNumber = @event.StreetNumber;
         dto.PostalCode   = @event.PostalCode;
         dto.City         = @event.City;
         session.SaveChanges();
     }
 }