Method AddParam
- Namespace
- Open.Database.Extensions
- Assembly
- Open.Database.Extensions.Core.dll
AddParam<TValue>(string, TValue)
Adds a named parameter before the source is known.
public UnboundCall<T> AddParam<TValue>(string name, TValue value)
Parameters
namestringThe name of the parameter, with or without its prefix.
valueTValueThe value.
Returns
- UnboundCall<T>
The parameters so far, to be given a source with
Using.
Type Parameters
TValueThe type of the value.
Remarks
For fewer allocations, declare the values with Params<TParams>() and a readonly record struct.
Exceptions
- ArgumentNullException
nameis null.
AddParam(string, string?)
Adds a named parameter before the source is known.
public UnboundCall<T> AddParam(string name, string? value)
Parameters
Returns
- UnboundCall<T>
The parameters so far, to be given a source with
Using.
Remarks
For fewer allocations, declare the values with Params<TParams>() and a readonly record struct.
Exceptions
- ArgumentNullException
nameis null.
AddParam<TValue>(TValue, string?)
Adds a parameter whose name is derived from the argument's expression, before the source is known.
public UnboundCall<T> AddParam<TValue>(TValue value, string? expression = null)
Parameters
valueTValueThe value.
expressionstringThe text of the argument, filled in by the compiler.
Returns
- UnboundCall<T>
The parameters so far, to be given a source with
Using.
Type Parameters
TValueThe type of the value.
Exceptions
- ArgumentException
A name cannot be derived from the argument.