/// <summary> /// Serialize the value into a collection of name -> value pairs using its ToString method /// </summary> /// <param name="formatProvider"><see cref="IFormatProvider"/> given to the <see cref="Requester"/>, if any</param> /// <returns>Serialized value</returns> public override IEnumerable <KeyValuePair <string, string?> > SerializeToString(IFormatProvider?formatProvider) { if (this.values == null) { yield break; } foreach (var value in this.values) { if (value == null) { continue; } yield return(new KeyValuePair <string, string?>(this.name, ToStringHelper.ToString(value, this.format, formatProvider))); } }
/// <summary> /// Serialize the value into a collection of name -> value pairs using its ToString method /// </summary> /// <param name="formatProvider"><see cref="IFormatProvider"/> to use if the value implements <see cref="IFormattable"/></param> /// <returns>Serialized value</returns> public KeyValuePair <string, string> SerializeToString(IFormatProvider formatProvider) { return(new KeyValuePair <string, string>(this.name, ToStringHelper.ToString(this.value, this.format, formatProvider))); }