Example #1
0
 public void Handle(AnchorAssignmentsCreated @event)
 {
     if (!ProcessOrder(order => order.Id == @event.OrderId, order => order.AssignmentsId = @event.SourceId))
     {
         logger.LogError("Failed to locate the order with {0} for the seat assignments being created with id {1}.", @event.OrderId, @event.SourceId);
     }
 }
 /// <summary>
 /// Saves the seat assignments correlation ID for further lookup.
 /// </summary>
 public void Handle(AnchorAssignmentsCreated @event)
 {
     using (var context = this.contextFactory.Create())
     {
         var dto = DbContext.Find <PricedOrder>(@event.OrderId);
         dto.AssignmentsId = @event.SourceId;
         // Note: @event.Version does not correspond to order.Version.;
         context.SaveChanges();
     }
 }
Example #3
0
        public void Handle(AnchorAssignmentsCreated @event)
        {
            using (var scope = factory.CreateReadOnly())
            {
                var seatTypes = this.workshopDao.GetAnchorTypeNames(@event.Anchors.Select(x => x.SeatType))
                                .ToDictionary(x => x.ID, x => x.Name);

                var dto = new OrderAnchors(@event.SourceId, @event.OrderId, @event.Anchors.Select(i =>
                                                                                                  new OrderAnchor(i.Position, seatTypes.TryGetValue(i.SeatType))));
                Save(dto);
            }
        }
Example #4
0
 private void OnCreated(AnchorAssignmentsCreated e)
 {
     this.anchors = e.Anchors.ToDictionary(x => x.Position, x => new AnchorAssignment {
         Position = x.Position, AnchorType = x.SeatType
     });
 }