Table of Contents

Class StoredProcedure

Namespace
Rinku.Querying.Defaults
Assembly
Rinku.dll

Reads stored procedure parameter names, types, sizes, and directions from the database. Use FromProc(string, IDbConnection, bool) while creating a command.

public static class StoredProcedure
Inheritance
StoredProcedure
Inherited Members

Fields

ParameterDeriver

How a procedure's parameters are read onto a command. Every provider ships this as DeriveParameters on its command builder, and the default finds that one by the name the provider gave it, so this only needs setting for a provider that breaks the convention or to put something else in its place.

public static Action<IDbCommand> ParameterDeriver

Field Value

Action<IDbCommand>

Methods

DeriveThroughProvider(IDbCommand)

Reads a procedure through the command builder the provider ships beside its command, which is named for it. A SqlCommand is read by SqlCommandBuilder and an NpgsqlCommand by NpgsqlCommandBuilder. The one found for a command type is kept, so the search happens once.

public static void DeriveThroughProvider(IDbCommand command)

Parameters

command IDbCommand

From(IDbConnection, string, bool)

The command for a procedure, reading what it declares through ParameterDeriver.

public static QueryCommand From(IDbConnection connection, string procedureName, bool inputOutputHasDefault = true)

Parameters

connection IDbConnection

The connection to ask, opened for the question if it is not already.

procedureName string

The procedure to call.

inputOutputHasDefault bool

Whether provider-derived input/output parameters may be omitted.

Returns

QueryCommand

FromAsync(DbConnection, string, CancellationToken, bool)

The command for a procedure, reading what it declares through ParameterDeriver, opening the connection asynchronously when it is not already open.

public static Task<QueryCommand> FromAsync(DbConnection connection, string procedureName, CancellationToken ct = default, bool inputOutputHasDefault = true)

Parameters

connection DbConnection

The connection to ask, opened for the question if it is not already.

procedureName string

The procedure to call.

ct CancellationToken

The forwarded cancellation token.

inputOutputHasDefault bool

Whether provider-derived input/output parameters may be omitted.

Returns

Task<QueryCommand>

FromCommand(IDbCommand, bool)

The command for a procedure whose parameters are already on command, put there by a deriver or by hand. They are taken as the procedure's declaration, for their names and for how each one binds.

public static QueryCommand FromCommand(IDbCommand command, bool inputOutputHasDefault = true)

Parameters

command IDbCommand

A command naming the procedure, carrying its parameters.

inputOutputHasDefault bool

Whether provider-derived input/output parameters may be omitted.

Returns

QueryCommand