Table of Contents

Class SqlStatementExpressionFactoryExtensions

Namespace
LfrlAnvil.Sql.Statements.Compilers
Assembly
LfrlAnvil.Sql.Core.dll

Contains various statement expression factory extension methods.

public static class SqlStatementExpressionFactoryExtensions
Inheritance
SqlStatementExpressionFactoryExtensions
Inherited Members

Methods

CreateAsyncExpression<TRow>(ISqlQueryReaderFactory, SqlQueryReaderCreationOptions?)

Creates a new SqlAsyncQueryReaderExpression<TRow> instance.

[Pure]
public static SqlAsyncQueryReaderExpression<TRow> CreateAsyncExpression<TRow>(this ISqlQueryReaderFactory factory, SqlQueryReaderCreationOptions? options = null) where TRow : notnull

Parameters

factory ISqlQueryReaderFactory

Source factory.

options SqlQueryReaderCreationOptions?

Optional SqlQueryReaderCreationOptions.

Returns

SqlAsyncQueryReaderExpression<TRow>

New SqlAsyncQueryReaderExpression<TRow> instance.

Type Parameters

TRow

Row type.

Exceptions

SqlCompilerException

When TRow is not a valid row type or does not contain a valid constructor or does not contain any valid members or this factory does not support asynchronous expressions.

CreateAsyncScalarExpression<T>(ISqlQueryReaderFactory, bool)

[Pure]
public static SqlAsyncScalarQueryReaderExpression<T> CreateAsyncScalarExpression<T>(this ISqlQueryReaderFactory factory, bool isNullable = false)

Parameters

factory ISqlQueryReaderFactory

Source factory.

isNullable bool

Specifies whether or not the result is nullable. Equal to false by default.

Returns

SqlAsyncScalarQueryReaderExpression<T>

New SqlAsyncScalarQueryReaderExpression<T> instance.

Type Parameters

T

Value type.

Exceptions

SqlCompilerException

When T is not a valid result type or this factory does not support asynchronous expressions.

CreateAsyncScalar<T>(ISqlQueryReaderFactory, bool)

Creates a new compiled SqlAsyncScalarQueryReader<T> instance.

[Pure]
public static SqlAsyncScalarQueryReader<T> CreateAsyncScalar<T>(this ISqlQueryReaderFactory factory, bool isNullable = false)

Parameters

factory ISqlQueryReaderFactory

Source factory.

isNullable bool

Specifies whether or not the result is nullable. Equal to false by default.

Returns

SqlAsyncScalarQueryReader<T>

New SqlAsyncScalarQueryReader<T> instance.

Type Parameters

T

Value type.

Exceptions

SqlCompilerException

When T is not a valid result type or this factory does not support asynchronous expressions.

CreateAsync<TRow>(ISqlQueryReaderFactory, SqlQueryReaderCreationOptions?)

Creates a new compiled SqlAsyncQueryReader<TRow> instance.

[Pure]
public static SqlAsyncQueryReader<TRow> CreateAsync<TRow>(this ISqlQueryReaderFactory factory, SqlQueryReaderCreationOptions? options = null) where TRow : notnull

Parameters

factory ISqlQueryReaderFactory

Source factory.

options SqlQueryReaderCreationOptions?

Optional SqlQueryReaderCreationOptions.

Returns

SqlAsyncQueryReader<TRow>

New SqlAsyncQueryReader<TRow> instance.

Type Parameters

TRow

Row type.

Exceptions

SqlCompilerException

When TRow is not a valid row type or does not contain a valid constructor or does not contain any valid members or this factory does not support asynchronous expressions.

CreateExpression<TSource>(ISqlParameterBinderFactory, SqlParameterBinderCreationOptions?)

Creates a new SqlParameterBinderExpression<TSource> instance.

[Pure]
public static SqlParameterBinderExpression<TSource> CreateExpression<TSource>(this ISqlParameterBinderFactory factory, SqlParameterBinderCreationOptions? options = null) where TSource : notnull

Parameters

factory ISqlParameterBinderFactory

Source factory.

options SqlParameterBinderCreationOptions?

Optional SqlParameterBinderCreationOptions.

Returns

SqlParameterBinderExpression<TSource>

New SqlParameterBinderExpression<TSource> instance.

Type Parameters

TSource

Parameter source type.

Exceptions

SqlCompilerException

When TSource is not a valid parameter source type or does not contain any valid members.

CreateExpression<TRow>(ISqlQueryReaderFactory, SqlQueryReaderCreationOptions?)

Creates a new SqlQueryReaderExpression<TRow> instance.

[Pure]
public static SqlQueryReaderExpression<TRow> CreateExpression<TRow>(this ISqlQueryReaderFactory factory, SqlQueryReaderCreationOptions? options = null) where TRow : notnull

Parameters

factory ISqlQueryReaderFactory

Source factory.

options SqlQueryReaderCreationOptions?

Optional SqlQueryReaderCreationOptions.

Returns

SqlQueryReaderExpression<TRow>

New SqlQueryReaderExpression<TRow> instance.

Type Parameters

TRow

Row type.

Exceptions

SqlCompilerException

When TRow is not a valid row type or does not contain a valid constructor or does not contain any valid members.

CreateScalarExpression<T>(ISqlQueryReaderFactory, bool)

Creates a new SqlScalarQueryReaderExpression<T> instance.

[Pure]
public static SqlScalarQueryReaderExpression<T> CreateScalarExpression<T>(this ISqlQueryReaderFactory factory, bool isNullable = false)

Parameters

factory ISqlQueryReaderFactory

Source factory.

isNullable bool

Specifies whether or not the result is nullable. Equal to false by default.

Returns

SqlScalarQueryReaderExpression<T>

New SqlScalarQueryReaderExpression<T> instance.

Type Parameters

T

Value type.

Exceptions

SqlCompilerException

When T is not a valid result type.

CreateScalar<T>(ISqlQueryReaderFactory, bool)

Creates a new compiled SqlScalarQueryReader<T> instance.

[Pure]
public static SqlScalarQueryReader<T> CreateScalar<T>(this ISqlQueryReaderFactory factory, bool isNullable = false)

Parameters

factory ISqlQueryReaderFactory

Source factory.

isNullable bool

Specifies whether or not the result is nullable. Equal to false by default.

Returns

SqlScalarQueryReader<T>

New SqlScalarQueryReader<T> instance.

Type Parameters

T

Value type.

Exceptions

SqlCompilerException

When T is not a valid result type.

Create<TSource>(ISqlParameterBinderFactory, SqlParameterBinderCreationOptions?)

Creates a new compiled SqlParameterBinder<TSource> instance.

[Pure]
public static SqlParameterBinder<TSource> Create<TSource>(this ISqlParameterBinderFactory factory, SqlParameterBinderCreationOptions? options = null) where TSource : notnull

Parameters

factory ISqlParameterBinderFactory

Source factory.

options SqlParameterBinderCreationOptions?

Optional SqlParameterBinderCreationOptions.

Returns

SqlParameterBinder<TSource>

New SqlParameterBinder<TSource> instance.

Type Parameters

TSource

Parameter source type.

Exceptions

SqlCompilerException

When TSource is not a valid parameter source type or does not contain any valid members.

Create<TRow>(ISqlQueryReaderFactory, SqlQueryReaderCreationOptions?)

Creates a new compiled SqlQueryReader<TRow> instance.

[Pure]
public static SqlQueryReader<TRow> Create<TRow>(this ISqlQueryReaderFactory factory, SqlQueryReaderCreationOptions? options = null) where TRow : notnull

Parameters

factory ISqlQueryReaderFactory

Source factory.

options SqlQueryReaderCreationOptions?

Optional SqlQueryReaderCreationOptions.

Returns

SqlQueryReader<TRow>

New SqlQueryReader<TRow> instance.

Type Parameters

TRow

Row type.

Exceptions

SqlCompilerException

When TRow is not a valid row type or does not contain a valid constructor or does not contain any valid members.