Files
csharp/src/KubernetesClient/Utilities.cs
Boshi Lian 5be3cff425 Style fix final (#523)
* all net5

* var

* SA1310

* SA1310

* allow 1031

* SA1805

* fix SA1642

* remove unused code

* allow sa1405

* isempty

* fix CA1714

* fix CA1806

* remove always false if

* fix format

* fix CA1062

* allow SA0001

* fix CA1062

* allow ca1034 and temp allow ca1835

* fix 16XX doc related warnings

* elm SA16XX

* elm SA16XX

* fix CA2213

* revert to pass all test

* move unclear rule to ruleset

* follow up of moving ruleset

* remove this

* fix test flaky
2020-11-22 14:52:09 -08:00

28 lines
690 B
C#

using System;
using System.Text;
namespace k8s
{
internal static class Utilities
{
internal static void AddQueryParameter(StringBuilder sb, string key, string value)
{
if (sb == null)
{
throw new ArgumentNullException(nameof(sb));
}
if (string.IsNullOrEmpty(key))
{
throw new ArgumentNullException(nameof(key));
}
sb.Append(sb.Length != 0 ? '&' : '?').Append(Uri.EscapeDataString(key)).Append('=');
if (!string.IsNullOrEmpty(value))
{
sb.Append(Uri.EscapeDataString(value));
}
}
}
}