public void Handle(SeatAssignmentUpdated @event)
        {
            var dto  = Find(@event.SourceId);
            var seat = dto.Seats.First(x => x.Position == @event.Position);

            Mapper.Map(@event, seat);
            Save(dto);
        }
 private void OnSeatAssignmentUpdated(SeatAssignmentUpdated e)
 {
     this._seats[e.Position] = Mapper.Map(e, new SeatAssignment()
     {
         SeatType = this._seats[e.Position].SeatType,
         Attendee = new PersonalInfo()
         {
             Email = this._seats[e.Position].Attendee.Email
         }
     });
 }
Ejemplo n.º 3
0
 private void OnSeatAssignmentUpdated(SeatAssignmentUpdated e)
 {
     seats[e.Position] = Mapper.Map(e, new SeatAssignment {
         // Seat type is also never received again from the client.
         SeatType = seats[e.Position].SeatType,
         // The email property is not received for updates, as those
         // are for the same attendee essentially.
         Attendee = new PersonalInfo {
             Email = seats[e.Position].Attendee.Email
         }
     });
 }
Ejemplo n.º 4
0
 public void Handle(SeatAssignmentUpdated @event)
 {
     if (!ProcessOrder(order => order.AssignmentsId == @event.SourceId, order => {
         var seat = order.Seats.FirstOrDefault(x => x.Position == @event.Position);
         if (seat != null)
         {
             seat.Attendee.FirstName = @event.Attendee.FirstName;
             seat.Attendee.LastName = @event.Attendee.LastName;
         }
         else
         {
             Trace.TraceError("Failed to locate the seat being updated at position {0} for assignment {1}.", @event.Position, @event.SourceId);
         }
     }))
     {
         Trace.TraceError("Failed to locate the order with seat assignments id {0} for the seat assignment being updated at position {1}.", @event.SourceId, @event.Position);
     }
 }