public void TranslateTo(Messages.RequestedChange message) { if (message == null) { throw new ArgumentNullException(nameof(message)); } message.AddRoadSegment = new Messages.AddRoadSegment { TemporaryId = TemporaryId, StartNodeId = StartNodeId, EndNodeId = EndNodeId, Geometry = GeometryTranslator.Translate(Geometry), MaintenanceAuthority = MaintenanceAuthority, GeometryDrawMethod = GeometryDrawMethod, Morphology = Morphology, Status = Status, Category = Category, AccessRestriction = AccessRestriction, LeftSideStreetNameId = LeftSideStreetNameId.GetValueOrDefault(), RightSideStreetNameId = RightSideStreetNameId.GetValueOrDefault(), Lanes = Lanes .Select(item => new Messages.RequestedRoadSegmentLaneAttribute { AttributeId = item.TemporaryId, Count = item.Count, Direction = item.Direction, FromPosition = item.From, ToPosition = item.To }) .ToArray(), Widths = Widths .Select(item => new Messages.RequestedRoadSegmentWidthAttribute { AttributeId = item.TemporaryId, Width = item.Width, FromPosition = item.From, ToPosition = item.To }) .ToArray(), Surfaces = Surfaces .Select(item => new Messages.RequestedRoadSegmentSurfaceAttribute { AttributeId = item.TemporaryId, Type = item.Type, FromPosition = item.From, ToPosition = item.To }) .ToArray() }; }
public void TranslateTo(Messages.RequestedChange message) { if (message == null) { throw new ArgumentNullException(nameof(message)); } message.AddRoadSegmentToEuropeanRoad = new Messages.AddRoadSegmentToEuropeanRoad { TemporaryAttributeId = TemporaryAttributeId, Number = Number, SegmentId = SegmentId }; }
public void TranslateTo(Messages.RequestedChange message) { if (message == null) { throw new ArgumentNullException(nameof(message)); } message.AddRoadNode = new Messages.AddRoadNode { TemporaryId = TemporaryId, Type = Type.ToString(), Geometry = GeometryTranslator.Translate(Geometry) }; }
public RoadNetworkChangesArchiveEventModule( IBlobClient client, IZipArchiveTranslator translator, IStreamStore store) { if (client == null) { throw new ArgumentNullException(nameof(client)); } if (translator == null) { throw new ArgumentNullException(nameof(translator)); } if (store == null) { throw new ArgumentNullException(nameof(store)); } For <Messages.RoadNetworkChangesArchiveAccepted>() .UseRoadNetworkCommandQueue(store) .Handle(async(queue, message, ct) => { var archiveId = new ArchiveId(message.Body.ArchiveId); var archiveBlob = await client.GetBlobAsync(new BlobName(archiveId), ct); using (var archiveBlobStream = await archiveBlob.OpenAsync(ct)) using (var archive = new ZipArchive(archiveBlobStream, ZipArchiveMode.Read, false)) { var requestedChanges = new List <Messages.RequestedChange>(); var translatedChanges = translator.Translate(archive); foreach (var change in translatedChanges) { var requestedChange = new Messages.RequestedChange(); change.TranslateTo(requestedChange); requestedChanges.Add(requestedChange); } var command = new Command(new Messages.ChangeRoadNetworkBasedOnArchive { ArchiveId = archiveId, Changes = requestedChanges.ToArray(), Reason = translatedChanges.Reason, Operator = translatedChanges.Operator, OrganizationId = translatedChanges.Organization }) .WithMessageId(message.MessageId); await queue.Write(command, ct); } }); }
public void TranslateTo(Messages.RequestedChange message) { if (message == null) { throw new ArgumentNullException(nameof(message)); } message.AddGradeSeparatedJunction = new Messages.AddGradeSeparatedJunction { TemporaryId = TemporaryId, Type = Type.ToString(), UpperSegmentId = UpperSegmentId, LowerSegmentId = LowerSegmentId }; }
public void TranslateTo(Messages.RequestedChange message) { if (message == null) { throw new ArgumentNullException(nameof(message)); } message.AddRoadSegmentToNumberedRoad = new Messages.AddRoadSegmentToNumberedRoad { TemporaryAttributeId = TemporaryAttributeId, Ident8 = Number, Direction = Direction, Ordinal = Ordinal, SegmentId = SegmentId }; }