public void Handle(CustomerRelocatedEvent @event)
 {
     using (var session = _documentStore.OpenSession())
     {
         var dto = session.Load <CustomerListDto>(Dto.GetDtoIdOf <CustomerListDto>(@event.AggregateId));
         dto.City = @event.City;
         session.SaveChanges();
     }
 }
 public void Handle(CustomerRelocatedEvent @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();
     }
 }
        public void Consume(CustomerRelocatedEvent @event)
        {
            using (var session = _documentStore.OpenSession())
            {
                var dto = new CustomerHasLivedInDto()
                {
                    AggregateRootId = @event.AggregateId
                };

                dto.AddCity(@event.City);

                session.Store(dto);
                session.SaveChanges();
            }
        }
Exemplo n.º 4
0
 private void Apply(CustomerRelocatedEvent @event)
 {
     // neither do we here, at this point in time since we've already sent the event.
     //new Address(@event.Street, @event.StreetNumber, @event.PostalCode, @event.City);
 }
Exemplo n.º 5
0
 private void Apply(CustomerRelocatedEvent @event)
 {
     _address = new Address(@event.Street, @event.StreetNumber, @event.PostalCode, @event.City);
 }