/// <summary> /// Upload the change set contents asynchronously. /// </summary> /// <param name="uploadURL">The URL to upload the contents to.</param> /// <returns>Does not return anything (no exception means success).</returns> private async Task UploadChangeSetContents(string uploadURL) { // Generate a change set to create many nodes var changeSetContent = new ChangeNodeRequest[ChangeSetNodeCount]; for (int nodeIdx = 0; nodeIdx < ChangeSetNodeCount; ++nodeIdx) { changeSetContent[nodeIdx] = new ChangeNodeRequest { Id = string.Format(ChangeSetNodeIDPattern, nodeIdx), // Optional (if not specified, the service will auto-generate it) Name = $"Change set node {nodeIdx}", // Optional Links = new string[ChangeSetNodeLinkCount], // Optional }; for (int linkIdx = 0; linkIdx < ChangeSetNodeLinkCount; ++linkIdx) { changeSetContent[nodeIdx].Links[linkIdx] = $"frn:DemoLink-{nodeIdx}-{linkIdx}"; } } Console.WriteLine("Uploading the change set contents..."); await this.changeSetClient.PutAsNDJsonAsync(uploadURL, changeSetContent).ConfigureAwait(false); }
public ChangeNodeRequestHandler(Request request, ClientConnection clientConnection, IChangeNodeOperationsService changeNodeOperationsService) { this.request = (ChangeNodeRequest)request; this.clientConnection = clientConnection; this.changeNodeOperationsService = changeNodeOperationsService; }