using System.Collections.Generic;
using Microsoft.AspNetCore.WebUtilities;
public static void Main()
var exampleUri = new Uri("https://example.com/");
var requestUri = QueryHelpers.AddQueryString(exampleUri.AbsoluteUri, new Dictionary<string,string>{
{ "myvar1", 123.ToString() },
{ "myvar2", "hello world" }
Console.WriteLine(requestUri);