Table of Contents

Struct SqlDatabaseFactoryStatementExecutor

Namespace
LfrlAnvil.Sql.Internal
Assembly
LfrlAnvil.Sql.Core.dll

Represents an executor of SQL statements ran by ISqlDatabaseFactory instances. Objects of this type invoke all ISqlDatabaseFactoryStatementListener instances specified in SqlCreateDatabaseOptions.

public struct SqlDatabaseFactoryStatementExecutor
Inherited Members

Properties

CommandTimeout

Optional explicit CommandTimeout.

public readonly TimeSpan? CommandTimeout { get; }

Property Value

TimeSpan?

Methods

Execute(DbCommand, SqlDatabaseFactoryStatementKey, SqlDatabaseFactoryStatementType, SqlDatabaseBuilderCommandAction)

Executes provided DbCommand synchronously.

public void Execute(DbCommand command, SqlDatabaseFactoryStatementKey key, SqlDatabaseFactoryStatementType type, SqlDatabaseBuilderCommandAction action)

Parameters

command DbCommand

Command to execute.

key SqlDatabaseFactoryStatementKey

SqlDatabaseFactoryStatementKey instance that identifies this SQL statement.

type SqlDatabaseFactoryStatementType

SqlDatabaseFactoryStatementType instance that specifies the type of this SQL statement.

action SqlDatabaseBuilderCommandAction

SqlDatabaseBuilderCommandAction instance that contains this SQL statement's definition.

ExecuteForVersionHistory(DbCommand, SqlDatabaseBuilderCommandAction, SqlDatabaseFactoryStatementType)

Executes provided DbCommand synchronously.

public void ExecuteForVersionHistory(DbCommand command, SqlDatabaseBuilderCommandAction action, SqlDatabaseFactoryStatementType type = SqlDatabaseFactoryStatementType.VersionHistory)

Parameters

command DbCommand

Command to execute.

action SqlDatabaseBuilderCommandAction

SqlDatabaseBuilderCommandAction instance that contains this SQL statement's definition.

type SqlDatabaseFactoryStatementType

SqlDatabaseFactoryStatementType instance that specifies the type of this SQL statement. Equal to VersionHistory by default.

ExecuteForVersionHistory<T>(DbCommand, Func<DbCommand, T>, SqlDatabaseFactoryStatementType)

Executes provided DbCommand synchronously.

public T ExecuteForVersionHistory<T>(DbCommand command, Func<DbCommand, T> invoker, SqlDatabaseFactoryStatementType type = SqlDatabaseFactoryStatementType.VersionHistory)

Parameters

command DbCommand

Command to execute.

invoker Func<DbCommand, T>

Delegate that invokes the provided command and returns the result.

type SqlDatabaseFactoryStatementType

SqlDatabaseFactoryStatementType instance that specifies the type of this SQL statement. Equal to VersionHistory by default.

Returns

T

Result of the invocation.

Type Parameters

T

Result type.

Execute<T>(DbCommand, SqlDatabaseFactoryStatementKey, SqlDatabaseFactoryStatementType, Func<DbCommand, T>)

Executes provided DbCommand synchronously.

public T Execute<T>(DbCommand command, SqlDatabaseFactoryStatementKey key, SqlDatabaseFactoryStatementType type, Func<DbCommand, T> invoker)

Parameters

command DbCommand

Command to execute.

key SqlDatabaseFactoryStatementKey

SqlDatabaseFactoryStatementKey instance that identifies this SQL statement.

type SqlDatabaseFactoryStatementType

SqlDatabaseFactoryStatementType instance that specifies the type of this SQL statement.

invoker Func<DbCommand, T>

Delegate that invokes the provided command and returns the result.

Returns

T

Result of the invocation.

Type Parameters

T

Result type.