public string ToQueryString(IArrayFormatter arrayFormatter)
{
if (!HasValue)
{
throw new NotSupportedException($"Could not convert the parameter {Name} to a query string because it did not have a value");
}
var enumerable = Value as Array;
if (enumerable != null)
{
return arrayFormatter.FormatParameter(Name, enumerable, ToQueryStringValue);
}
var value = ToQueryStringValue(Value);
return string.Concat(Name, "=", value);
}