Table of Contents

Method GetProcedureParameterNames

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

GetProcedureParameterNames(TConnection, string)

Gets the names of the parameters a stored procedure declares, so a parameter added with AddParam(value) can be matched to the real one.

protected virtual ImmutableArray<string> GetProcedureParameterNames(TConnection connection, string procedure)

Parameters

connection TConnection

An open connection to run the lookup on. A command that executes inside a transaction must use Transaction.

procedure string

The procedure name as given to the command.

Returns

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 provider that can look this up overrides it (ExpressiveDbCommand and ExpressiveCommand ask the ADO.NET schema collection ProcedureParameters); the default returns nothing, and the last member of each argument is used as written. Return the names exactly as the provider spells them: a leading @ is ignored when matching, nothing else is changed, and the name that is sent is the one returned. An empty or default array means "not known", which also covers a procedure that declares no parameters; that answer is remembered for a short time and replaces any older names of that procedure.