Method GetProcedureParameterNames
- Namespace
- Open.Database.Extensions
- Assembly
- Open.Database.Extensions.Core.dll
GetProcedureParameterNames(DbConnection, string)
Gets the parameter names a stored procedure declares through the ADO.NET schema collection ProcedureParameters, so parameters added with AddParam(value) find their real names on any provider that supports it (SQL Server does).
protected override ImmutableArray<string> GetProcedureParameterNames(DbConnection connection, string procedure)
Parameters
connectionDbConnectionAn open connection to run the lookup on. A command that executes inside a transaction must use Transaction.
procedurestringThe 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 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.