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())); } }
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); } }