Class DbConnectionPlusConfiguration

Namespace
RentADeveloper.DbConnectionPlus.Configuration
Assembly
RentADeveloper.DbConnectionPlus.dll

The configuration for DbConnectionPlus.

public sealed class DbConnectionPlusConfiguration : IFreezable
Inheritance
DbConnectionPlusConfiguration
Implements
Inherited Members
Extension Methods

Properties

EnumSerializationMode

public EnumSerializationMode EnumSerializationMode { get; set; }

Property Value

EnumSerializationMode

Exceptions

InvalidOperationException

An attempt was made to modify this property and the configuration of DbConnectionPlus is already frozen and can no longer be modified.

Instance

The singleton instance of DbConnectionPlusConfiguration.

public static DbConnectionPlusConfiguration Instance { get; }

Property Value

DbConnectionPlusConfiguration

InterceptDbCommand

A function that can be used to intercept database commands executed via DbConnectionPlus. Can be used for logging or modifying commands before execution.

public InterceptDbCommand? InterceptDbCommand { get; set; }

Property Value

InterceptDbCommand

Exceptions

InvalidOperationException

An attempt was made to modify this property and the configuration of DbConnectionPlus is already frozen and can no longer be modified.

Methods

Entity<TEntity>()

Gets a builder for configuring the entity type TEntity.

public EntityTypeBuilder<TEntity> Entity<TEntity>()

Returns

EntityTypeBuilder<TEntity>

A builder to configure the entity type.

Type Parameters

TEntity

The type of the entity to configure.

Exceptions

InvalidOperationException

The configuration of DbConnectionPlus is already frozen and can no longer be modified.

RegisterDatabaseAdapter<TConnection>(IDatabaseAdapter)

Registers a database adapter for the connection type TConnection. If an adapter is already registered for the connection type TConnection, the existing adapter is replaced.

public void RegisterDatabaseAdapter<TConnection>(IDatabaseAdapter adapter) where TConnection : DbConnection

Parameters

adapter IDatabaseAdapter

The database adapter to associate with the connection type TConnection.

Type Parameters

TConnection

The type of database connection for which adapter is being registered.

Exceptions

ArgumentNullException

adapter is null.