Class SqlQueryReaderFactory
- Namespace
- LfrlAnvil.Sql.Statements.Compilers
- Assembly
- LfrlAnvil.Sql.Core.dll
Represents a factory of delegates used by query reader expression instances.
public class SqlQueryReaderFactory : ISqlQueryReaderFactory
- Inheritance
-
SqlQueryReaderFactory
- Implements
- Derived
- Inherited Members
- Extension Methods
Properties
ColumnTypeDefinitions
Specifies ISqlColumnTypeDefinitionProvider instance attached to this factory.
public ISqlColumnTypeDefinitionProvider ColumnTypeDefinitions { get; }
Property Value
DataReaderType
Specifies the DB data reader type.
public Type DataReaderType { get; }
Property Value
Dialect
SQL dialect that this factory is associated with.
public SqlDialect Dialect { get; }
Property Value
SupportsAsync
Specifies whether or not generic asynchronous query readers can be constructed by this factory.
public bool SupportsAsync { get; }
Property Value
Methods
Create(SqlQueryReaderCreationOptions?)
Creates a new SqlQueryReader instance.
[Pure]
public SqlQueryReader Create(SqlQueryReaderCreationOptions? options = null)
Parameters
options
SqlQueryReaderCreationOptions?Optional SqlQueryReaderCreationOptions.
Returns
- SqlQueryReader
New SqlQueryReader instance.
CreateAsync(SqlQueryReaderCreationOptions?)
Creates a new SqlAsyncQueryReader instance.
[Pure]
public SqlAsyncQueryReader CreateAsync(SqlQueryReaderCreationOptions? options = null)
Parameters
options
SqlQueryReaderCreationOptions?Optional SqlQueryReaderCreationOptions.
Returns
- SqlAsyncQueryReader
New SqlAsyncQueryReader instance.
CreateAsyncExpression(Type, SqlQueryReaderCreationOptions?)
Creates a new SqlAsyncQueryReaderExpression instance.
[Pure]
public SqlAsyncQueryReaderExpression CreateAsyncExpression(Type rowType, SqlQueryReaderCreationOptions? options = null)
Parameters
rowType
TypeRow type.
options
SqlQueryReaderCreationOptions?Optional SqlQueryReaderCreationOptions.
Returns
- SqlAsyncQueryReaderExpression
New SqlAsyncQueryReaderExpression instance.
Exceptions
- SqlCompilerException
When
rowType
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.
CreateAsyncScalar()
Creates a new SqlAsyncScalarQueryReader instance.
[Pure]
public SqlAsyncScalarQueryReader CreateAsyncScalar()
Returns
- SqlAsyncScalarQueryReader
New SqlAsyncScalarQueryReader instance.
CreateAsyncScalarExpression(Type, bool)
Creates a new SqlAsyncScalarQueryReaderExpression instance.
[Pure]
public SqlAsyncScalarQueryReaderExpression CreateAsyncScalarExpression(Type resultType, bool isNullable = false)
Parameters
resultType
TypeValue type.
isNullable
boolSpecifies whether or not the result is nullable. Equal to false by default.
Returns
Exceptions
- SqlCompilerException
When
resultType
is not a valid result type or this factory does not support asynchronous expressions.
CreateExpression(Type, SqlQueryReaderCreationOptions?)
Creates a new SqlQueryReaderExpression instance.
[Pure]
public SqlQueryReaderExpression CreateExpression(Type rowType, SqlQueryReaderCreationOptions? options = null)
Parameters
rowType
TypeRow type.
options
SqlQueryReaderCreationOptions?Optional SqlQueryReaderCreationOptions.
Returns
- SqlQueryReaderExpression
New SqlQueryReaderExpression instance.
Exceptions
- SqlCompilerException
When
rowType
is not a valid row type or does not contain a valid constructor or does not contain any valid members.
CreateScalar()
Creates a new SqlScalarQueryReader instance.
[Pure]
public SqlScalarQueryReader CreateScalar()
Returns
- SqlScalarQueryReader
New SqlScalarQueryReader instance.
CreateScalarExpression(Type, bool)
Creates a new SqlScalarQueryReaderExpression instance.
[Pure]
public SqlScalarQueryReaderExpression CreateScalarExpression(Type resultType, bool isNullable = false)
Parameters
resultType
TypeValue type.
isNullable
boolSpecifies whether or not the result is nullable. Equal to false by default.
Returns
- SqlScalarQueryReaderExpression
New SqlScalarQueryReaderExpression instance.
Exceptions
- SqlCompilerException
When
resultType
is not a valid result type.