Document ArgumentNullException (#15)

This commit is contained in:
Oliver Booth 2022-04-30 10:35:50 +01:00
parent e757ce08a0
commit 49e5482b8f
No known key found for this signature in database
GPG Key ID: 32A00B35503AF634
1 changed files with 27 additions and 1 deletions

View File

@ -1,4 +1,4 @@
using System.Diagnostics.Contracts;
using System.Diagnostics.Contracts;
using System.Web;
namespace X10D.Collections;
@ -180,6 +180,7 @@ public static class DictionaryExtensions
/// <typeparam name="TValue">The type of the value element of the key/value pair.</typeparam>
/// <param name="source">The source dictionary.</param>
/// <returns>A <see cref="string" /> representing the dictionary as a key=value set, concatenated with <c>;</c>.</returns>
/// <exception cref="ArgumentNullException"><paramref name="source" /> is <see langword="null" />.</exception>
[Pure]
public static string ToConnectionString<TKey, TValue>(this IEnumerable<KeyValuePair<TKey, TValue>> source)
{
@ -217,6 +218,11 @@ public static class DictionaryExtensions
/// A transform function to apply to the <see cref="KeyValuePair{TKey,TValue}.Value" /> of each element.
/// </param>
/// <returns>A <see cref="string" /> representing the dictionary as a key=value set, concatenated with <c>;</c>.</returns>
/// <exception cref="ArgumentNullException">
/// <para><paramref name="source" /> is <see langword="null" />.</para>
/// -or-
/// <para><paramref name="selector" /> is <see langword="null" />.</para>
/// </exception>
[Pure]
public static string ToConnectionString<TKey, TValue>(this IEnumerable<KeyValuePair<TKey, TValue>> source,
Func<TValue, string?> selector)
@ -263,6 +269,13 @@ public static class DictionaryExtensions
/// A transform function to apply to the <see cref="KeyValuePair{TKey,TValue}.Value" /> of each element.
/// </param>
/// <returns>A <see cref="string" /> representing the dictionary as a key=value set, concatenated with <c>;</c>.</returns>
/// <exception cref="ArgumentNullException">
/// <para><paramref name="source" /> is <see langword="null" />.</para>
/// -or-
/// <para><paramref name="keySelector" /> is <see langword="null" />.</para>
/// -or-
/// <para><paramref name="valueSelector" /> is <see langword="null" />.</para>
/// </exception>
[Pure]
public static string ToConnectionString<TKey, TValue>(this IEnumerable<KeyValuePair<TKey, TValue>> source,
Func<TKey, string> keySelector, Func<TValue, string?> valueSelector)
@ -308,6 +321,7 @@ public static class DictionaryExtensions
/// <typeparam name="TValue">The type of the value element of the key/value pair.</typeparam>
/// <param name="source">The source dictionary.</param>
/// <returns>A <see cref="string" /> representing the dictionary as a key=value set, concatenated with <c>&amp;</c>.</returns>
/// <exception cref="ArgumentNullException"><paramref name="source" /> is <see langword="null" />.</exception>
[Pure]
public static string ToGetParameters<TKey, TValue>(this IEnumerable<KeyValuePair<TKey, TValue>> source)
where TKey : notnull
@ -337,6 +351,11 @@ public static class DictionaryExtensions
/// A transform function to apply to the <see cref="KeyValuePair{TKey,TValue}.Value" /> of each element.
/// </param>
/// <returns>A <see cref="string" /> representing the dictionary as a key=value set, concatenated with <c>&amp;</c>.</returns>
/// <exception cref="ArgumentNullException">
/// <para><paramref name="source" /> is <see langword="null" />.</para>
/// -or-
/// <para><paramref name="selector" /> is <see langword="null" />.</para>
/// </exception>
[Pure]
public static string ToGetParameters<TKey, TValue>(this IEnumerable<KeyValuePair<TKey, TValue>> source,
Func<TValue, string?> selector)
@ -376,6 +395,13 @@ public static class DictionaryExtensions
/// A transform function to apply to the <see cref="KeyValuePair{TKey,TValue}.Value" /> of each element.
/// </param>
/// <returns>A <see cref="string" /> representing the dictionary as a key=value set, concatenated with <c>&amp;</c>.</returns>
/// <exception cref="ArgumentNullException">
/// <para><paramref name="source" /> is <see langword="null" />.</para>
/// -or-
/// <para><paramref name="keySelector" /> is <see langword="null" />.</para>
/// -or-
/// <para><paramref name="valueSelector" /> is <see langword="null" />.</para>
/// </exception>
[Pure]
public static string ToGetParameters<TKey, TValue>(this IEnumerable<KeyValuePair<TKey, TValue>> source,
Func<TKey, string> keySelector, Func<TValue, string?> valueSelector)