private void OnSeatUnassigned(SeatUnassigned e)
 {
     this._seats[e.Position] = Mapper.Map(e, new SeatAssignment()
     {
         SeatType = this._seats[e.Position].SeatType
     });
 }
        public void Handle(SeatUnassigned @event)
        {
            var dto  = Find(@event.SourceId);
            var seat = dto.Seats.First(x => x.Position == @event.Position);

            seat.Attendee.Email = seat.Attendee.FirstName = seat.Attendee.LastName = null;
            Save(dto);
        }
 public Task <AsyncTaskResult> HandleAsync(SeatUnassigned evnt)
 {
     return(TryUpdateRecordAsync(connection =>
     {
         return connection.UpdateAsync(new
         {
             AttendeeFirstName = string.Empty,
             AttendeeLastName = string.Empty,
             AttendeeEmail = string.Empty
         }, new
         {
             AssignmentsId = evnt.AggregateRootId,
             Position = evnt.Position
         }, ConfigSettings.OrderSeatAssignmentsTable);
     }));
 }
示例#4
0
 public void Handle(SeatUnassigned @event)
 {
     if (!ProcessOrder(order => order.AssignmentsId == @event.SourceId, order => {
         var seat = order.Seats.FirstOrDefault(x => x.Position == @event.Position);
         if (seat != null)
         {
             order.Seats.Remove(seat);
         }
         else
         {
             Trace.TraceError("Failed to locate the seat being unassigned 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 being unassigned at position {1}.", @event.SourceId, @event.Position);
     }
 }