Beispiel #1
0
 private void Save(OrderAnchors dto)
 {
     using (var writer = new StringWriter())
     {
         this.serializer.Serialize(writer, dto);
         this.storage.Save(GetAnchorAssignmentsBlobId(dto.AssignmentsId), "text/plain", Encoding.UTF8.GetBytes(writer.ToString()));
     }
 }
Beispiel #2
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);
            }
        }