using System; using System.Collections.Generic; using System.Linq; namespace LineMessaging { internal static class DictionaryExtensions { internal static string ToQueryString(this Dictionary source) { if (source == null) throw new ArgumentNullException(); if (source.Count == 0) return string.Empty; return "?" + string.Join("&", source.Select(x => $"{x.Key}={x.Value}")); } } }