Table of Contents

Method GetProcedureParameterNamesAsync

Namespace
Open.Database.Extensions
Assembly
Open.Database.Extensions.Core.dll

GetProcedureParameterNamesAsync(DbConnection, string, CancellationToken)

Asynchronously gets the parameter names a stored procedure declares through the ADO.NET schema collection ProcedureParameters.

protected override ValueTask<ImmutableArray<string>> GetProcedureParameterNamesAsync(DbConnection connection, string procedure, CancellationToken cancellationToken)

Parameters

connection DbConnection

An open connection to run the lookup on.

procedure string

The procedure name as given to the command.

cancellationToken CancellationToken

A token that can cancel the lookup.

Returns

ValueTask<ImmutableArray<string>>

The names as the provider reports them (a leading @ is fine), or an empty or default array when they are not known.

Remarks

A name with a database part (otherdb.dbo.proc) is not looked up, because the lookup runs in the connection's current database; a name that exists in more than one schema (when no schema is given) is not known either, and neither is anything from a provider that does not implement the collection: in each case the last member of each argument is used as written.

A failure of the lookup is thrown as it is, a DbException staying one, with the procedure's name added to Data under the key Procedure.