Interface IDataProvider
- Namespace
- LinqToDB.DataProvider
- Assembly
- linq2db.dll
public interface IDataProvider
- Extension Methods
Properties
ConnectionNamespace
string? ConnectionNamespace { get; }
Property Value
DataReaderType
Type DataReaderType { get; }
Property Value
ID
int ID { get; }
Property Value
MappingSchema
MappingSchema MappingSchema { get; }
Property Value
Name
string Name { get; }
Property Value
SqlProviderFlags
SqlProviderFlags SqlProviderFlags { get; }
Property Value
SupportedTableOptions
TableOptions SupportedTableOptions { get; }
Property Value
TransactionsSupported
bool TransactionsSupported { get; }
Property Value
Methods
BulkCopyAsync<T>(DataOptions, ITable<T>, IEnumerable<T>, CancellationToken)
Task<BulkCopyRowsCopied> BulkCopyAsync<T>(DataOptions options, ITable<T> table, IEnumerable<T> source, CancellationToken cancellationToken) where T : notnull
Parameters
options
DataOptionstable
ITable<T>source
IEnumerable<T>cancellationToken
CancellationToken
Returns
Type Parameters
T
BulkCopy<T>(DataOptions, ITable<T>, IEnumerable<T>)
BulkCopyRowsCopied BulkCopy<T>(DataOptions options, ITable<T> table, IEnumerable<T> source) where T : notnull
Parameters
options
DataOptionstable
ITable<T>source
IEnumerable<T>
Returns
Type Parameters
T
ConvertParameterType(Type, DbDataType)
Type ConvertParameterType(Type type, DbDataType dataType)
Parameters
type
TypedataType
DbDataType
Returns
CreateConnection(string)
DbConnection CreateConnection(string connectionString)
Parameters
connectionString
string
Returns
CreateSqlBuilder(MappingSchema, DataOptions)
ISqlBuilder CreateSqlBuilder(MappingSchema mappingSchema, DataOptions dataOptions)
Parameters
mappingSchema
MappingSchemadataOptions
DataOptions
Returns
DisposeCommand(DbCommand)
void DisposeCommand(DbCommand command)
Parameters
command
DbCommand
ExecuteScope(DataConnection)
Returns scoped context object to wrap calls of Execute* methods. Using this, provider could e.g. change thread culture during Execute* calls. Following calls wrapped right now: DataConnection.ExecuteNonQuery DataConnection.ExecuteReader.
IExecutionScope? ExecuteScope(DataConnection dataConnection)
Parameters
dataConnection
DataConnectionData connection instance used with scope.
Returns
- IExecutionScope
Returns disposable scope object. Can be
null
.
GetCommandBehavior(CommandBehavior)
CommandBehavior GetCommandBehavior(CommandBehavior commandBehavior)
Parameters
commandBehavior
CommandBehavior
Returns
GetConnectionInfo(DataConnection, string)
object? GetConnectionInfo(DataConnection dataConnection, string parameterName)
Parameters
dataConnection
DataConnectionparameterName
string
Returns
GetQueryParameterNormalizer()
Returns instance of IQueryParametersNormalizer, which implements normalization logic for parameters of single query. E.g. it could include:
- trimming names that are too long
- removing/replacing unsupported characters
- name deduplication for parameters with same name
IQueryParametersNormalizer GetQueryParameterNormalizer()
Returns
GetReaderExpression(DbDataReader, int, Expression, Type)
Expression GetReaderExpression(DbDataReader reader, int idx, Expression readerExpression, Type toType)
Parameters
reader
DbDataReaderidx
intreaderExpression
ExpressiontoType
Type
Returns
GetSchemaProvider()
ISchemaProvider GetSchemaProvider()
Returns
GetSqlOptimizer(DataOptions)
ISqlOptimizer GetSqlOptimizer(DataOptions dataOptions)
Parameters
dataOptions
DataOptions
Returns
InitCommand(DataConnection, DbCommand, CommandType, string, DataParameter[]?, bool)
Initializes DataConnection command object.
DbCommand InitCommand(DataConnection dataConnection, DbCommand command, CommandType commandType, string commandText, DataParameter[]? parameters, bool withParameters)
Parameters
dataConnection
DataConnectionData connection instance to initialize with new command.
command
DbCommandCommand instance to initialize.
commandType
CommandTypeType of command.
commandText
stringCommand SQL.
parameters
DataParameter[]Optional list of parameters to add to initialized command.
withParameters
boolFlag to indicate that command has parameters. Used to configure parameters support when method called without parameters and parameters added later to command.
Returns
- DbCommand
Initialized command instance.
InitContext(IDataContext)
void InitContext(IDataContext dataContext)
Parameters
dataContext
IDataContext
IsDBNullAllowed(DataOptions, DbDataReader, int)
bool? IsDBNullAllowed(DataOptions options, DbDataReader reader, int idx)
Parameters
options
DataOptionsreader
DbDataReaderidx
int
Returns
- bool?
SetParameter(DataConnection, DbParameter, string, DbDataType, object?)
void SetParameter(DataConnection dataConnection, DbParameter parameter, string name, DbDataType dataType, object? value)
Parameters
dataConnection
DataConnectionparameter
DbParametername
stringdataType
DbDataTypevalue
object