Table of Contents

Class SqlParameters

Namespace
SqlBound
Assembly
SqlBound.dll

An immutable, named set of SQL parameter values. Null values are normalized to DBNull so callers can bind them to an ADO.NET parameter without a separate null check.

public sealed class SqlParameters
Inheritance
SqlParameters
Inherited Members

Constructors

SqlParameters(params (string Name, object? Value)[])

Initializes a new instance with the given named parameter values. Names must be non-empty and unique.

public SqlParameters(params (string Name, object? Value)[] parameters)

Parameters

parameters (string Name, object Value)[]

Exceptions

ArgumentException

A parameter name is null, empty, whitespace, or duplicated.

Properties

Count

The number of parameters in this set.

public int Count { get; }

Property Value

int

Empty

An empty parameter set.

public static SqlParameters Empty { get; }

Property Value

SqlParameters

Items

The parameters, in the order they were given. Values are never null; a null value provided at construction is normalized to Value.

public IReadOnlyList<KeyValuePair<string, object>> Items { get; }

Property Value

IReadOnlyList<KeyValuePair<string, object>>