Class SqlAddressKeys

Namespace
ProtoTest.Sql
Assembly
ProtoTest.Sql.dll

The code-declared configuration keys that can provide the SQL connection: sql => sql.AddressKeys.Add("ConnectionStrings:Orders"). The set is a code API, not a bound option: the capability decision is made when the host is built, before options bind, so a key that only configuration knows cannot promise a connection the build already decided against.

public sealed class SqlAddressKeys
Inheritance
SqlAddressKeys
Inherited Members
Extension Methods

Properties

Count

Gets the number of declared keys.

public int Count { get; }

Property Value

int

this[int]

Gets the declared key at index, in declaration order.

public string this[int index] { get; }

Parameters

index int

Property Value

string

Methods

Add(params string[])

Declares one or more configuration keys that can provide the connection. A key repeated in the same set is ignored; declaration order is kept.

public SqlAddressKeys Add(params string[] keys)

Parameters

keys string[]

Returns

SqlAddressKeys

Exceptions

ArgumentException

A key is null, empty or whitespace.

ToArray()

Returns a snapshot of the declared keys in declaration order.

public string[] ToArray()

Returns

string[]