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

Properties

ParameterDeriver

How a provider's procedure metadata is copied onto a command. The default locates the provider's DeriveParameters method by convention. Set this when a provider uses a different entry point.

public static Action<IDbCommand> ParameterDeriver { get; set; }

Property 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 used to inspect the procedure. It is opened temporarily when needed.

procedureName string

The procedure to call.

inputOutputHasDefault bool

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

Returns

QueryCommand

FromAsync(DbConnection, string, bool, CancellationToken)

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, bool inputOutputHasDefault = true, CancellationToken ct = default)

Parameters

connection DbConnection

The connection used to inspect the procedure. It is opened temporarily when needed.

procedureName string

The procedure to call.

inputOutputHasDefault bool

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

ct CancellationToken

The forwarded cancellation token.

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