Exemplo n.º 1
0
 private void Apply(TripUpdated @event)
 {
     Id               = @event.AggregateRootId;
     _end             = @event.Ended;
     _start           = @event.Started;
     _status          = @event.Status;
     _currentLocation = @event.CurrentLocation;
 }
Exemplo n.º 2
0
        Trip IEntityBuilder <Trip, TripUpdated> .Apply(Trip entity, TripUpdated @event)
        {
            if (@event.Destination != null)
            {
                entity.Destination = @event.Destination;
            }

            if (@event.IsCancelled.HasValue)
            {
                entity.IsCancelled = @event.IsCancelled.Value;
            }

            if (@event.Owner != null)
            {
                entity.Owner = @event.Owner;
            }

            entity.SequenceNumber = @event.SequenceNumber;

            return(entity);
        }