src/packages/EmbedIO/Authentication/BasicAuthenticationModuleExtensions.cs
/// <summary>
/// Adds a dictionary of user names and passwords to the <see cref="BasicAuthenticationModule.Accounts">Accounts</see> dictionary
/// of a <see cref="BasicAuthenticationModule"/>.
/// </summary>
/// <param name="this">The <see cref="BasicAuthenticationModule"/> on which this method is called.</param>
/// <param name="accounts">An enumeration of key / value pairs
/// representing the user names and passwords to add..</param>
/// <returns><paramref name="this"/>, with the user names and passwords in <paramref name="accounts"/>
/// added to the <see cref="BasicAuthenticationModule.Accounts">Accounts</see> dictionary.</returns>
/// <exception cref="NullReferenceException">
/// <para><paramref name="this"/> is <see langword="null"/>.</para>
/// <para>- or -</para>
/// <para><paramref name="accounts"/> is <see langword="null"/>.</para>
/// </exception>
/// <exception cref="ArgumentNullException">One or more of the keys in <paramref name="accounts"/> are <see langword="null"/>.</exception>
/// <exception cref="OverflowException">
/// <para>The <see cref="BasicAuthenticationModule.Accounts">Accounts</see> dictionary already contains
/// the maximum number of elements (<see cref="int.MaxValue">MaxValue</see>).</para>
/// </exception>
Adds a dictionary of user names and passwords to the Accounts.
Adds a dictionary of user names and passwords to the Accounts .
public static BasicAuthenticationModule WithAccounts(this BasicAuthenticationModule @this, [ValidatedNotNull] IEnumerable<KeyValuePair<string, string>> accounts)
        {
            foreach (var account in accounts)
            {
                @this.Accounts.AddOrUpdate(account.Key, account.Value, (_, __) => account.Value);
            }
            return @this;
        }
public static BasicAuthenticationModule WithAccounts ( this BasicAuthenticationModule @this , [ ValidatedNotNull ] IEnumerable < KeyValuePair < string , string > > accounts ) { foreach ( var account in accounts ) { @this . Accounts . AddOrUpdate ( account . Key , account . Value , ( _ , __ ) => account . Value ) ; } return @this ; }
Adds a dictionary of user names and passwords to the Accounts.
Adds a dictionary of user names and passwords to the Accounts .
, with the user names and passwords in
added to the Accounts
with the user names and passwords in added to the Accounts
None
One or more of the keys in  are .
One or more of the keys in are .
None
BasicAuthenticationModule
this
IEnumerable<KeyValuePair<string, string>>
[ValidatedNotNull]
this
The  on which this method is called.
The on which this method is called .
accounts
An enumeration of key / value pairs
representing the user names and passwords to add
An enumeration of key / value pairs representing the user names and passwords to add