DbConnectionPlus API Documentation
Search Results for

    Show / Hide Table of Contents

    Interface IDatabaseAdapter

    Represents an adapter that adapts DbConnectionPlus to a specific database system.

    Namespace: RentADeveloper.DbConnectionPlus.DatabaseAdapters
    Assembly: RentADeveloper.DbConnectionPlus.dll
    Syntax
    public interface IDatabaseAdapter

    Properties

    View Source

    EntityManipulator

    The entity manipulator for the database system this adapter supports.

    Declaration
    IEntityManipulator EntityManipulator { get; }
    Property Value
    Type Description
    IEntityManipulator
    View Source

    TemporaryTableBuilder

    The temporary table builder for the database system this adapter supports.

    Declaration
    ITemporaryTableBuilder TemporaryTableBuilder { get; }
    Property Value
    Type Description
    ITemporaryTableBuilder

    Methods

    View Source

    BindParameterValue(DbParameter, object?)

    Binds value to parameter.

    If value is an Enum value, it is serialized according to the setting EnumSerializationMode before being assigned to the parameter.

    Declaration
    void BindParameterValue(DbParameter parameter, object? value)
    Parameters
    Type Name Description
    DbParameter parameter

    The parameter to bind value to.

    object value

    The value to bind to parameter.

    Exceptions
    Type Condition
    ArgumentNullException

    parameter is null.

    View Source

    FormatParameterName(string)

    Returns parameterName with the appropriate prefix (e.g. "@" for SQL Server or ":" for Oracle) for use in SQL statements.

    Declaration
    string FormatParameterName(string parameterName)
    Parameters
    Type Name Description
    string parameterName

    The parameter name to format.

    Returns
    Type Description
    string

    parameterName formatted with the appropriate prefix, suitable for inclusion in SQL statements.

    View Source

    GetDataType(Type, EnumSerializationMode)

    Gets the corresponding database specific data type for the type type.

    Declaration
    string GetDataType(Type type, EnumSerializationMode enumSerializationMode)
    Parameters
    Type Name Description
    Type type

    The type to get the database specific data type for.

    EnumSerializationMode enumSerializationMode

    The mode to use to serialize Enum values.

    Returns
    Type Description
    string

    The corresponding database specific data type for the type type.

    Exceptions
    Type Condition
    ArgumentNullException

    type is null.

    ArgumentOutOfRangeException
    <ul><li>
                <code class="paramref">enumSerializationMode</code> is not a valid <xref href="RentADeveloper.DbConnectionPlus.EnumSerializationMode" data-throw-if-not-resolved="false"></xref>
    

    value.

  • The type type could not be mapped to a database specific data type.
  • View Source

    QuoteIdentifier(string)

    Returns identifier properly quoted for use in SQL statements.

    Declaration
    string QuoteIdentifier(string identifier)
    Parameters
    Type Name Description
    string identifier

    The identifier to be quoted.

    Returns
    Type Description
    string

    A string containing the quoted version of identifier, suitable for use in SQL statements.

    View Source

    QuoteTemporaryTableName(string, DbConnection)

    Returns the specified name of a temporary table properly quoted for use in SQL statements.

    Declaration
    string QuoteTemporaryTableName(string tableName, DbConnection connection)
    Parameters
    Type Name Description
    string tableName

    The temporary table name to quote.

    DbConnection connection

    The database connection to use for quoting.

    Returns
    Type Description
    string

    A string containing the quoted version of tableName, suitable for use in SQL statements.

    View Source

    SupportsTemporaryTables(DbConnection)

    Determines whether the database system this adapter supports has support for (local/session scoped) temporary tables.

    Declaration
    bool SupportsTemporaryTables(DbConnection connection)
    Parameters
    Type Name Description
    DbConnection connection

    The database connection to use to check for the support.

    Returns
    Type Description
    bool

    true if the database system supports temporary tables; otherwise, false.

    Remarks

    A database adapter returning true for this method must implement an ITemporaryTableBuilder and provide an instance of it via the TemporaryTableBuilder property.

    If a database adapter returns false for this method, it must throw a NotSupportedException from the TemporaryTableBuilder property.

    View Source

    WasSqlStatementCancelledByCancellationToken(Exception, CancellationToken)

    Determines whether exception was thrown because an SQL statement was cancelled via cancellationToken.

    Declaration
    bool WasSqlStatementCancelledByCancellationToken(Exception exception, CancellationToken cancellationToken)
    Parameters
    Type Name Description
    Exception exception

    The exception to inspect.

    CancellationToken cancellationToken

    The token via the SQL statement may have been cancelled.

    Returns
    Type Description
    bool

    true if exception was thrown because an SQL statement was cancelled via cancellationToken; otherwise, false.

    Exceptions
    Type Condition
    ArgumentNullException

    exception is null.

    • View Source
    In this article
    Back to top Generated by DocFX