Class ConnectionOptions
public sealed record ConnectionOptions : IOptionSet, IConfigurationID, IEquatable<ConnectionOptions>
- Inheritance
-
ConnectionOptions
- Implements
- Extension Methods
Constructors
ConnectionOptions()
public ConnectionOptions()
ConnectionOptions(string?, string?, IDataProvider?, string?, MappingSchema?, DbConnection?, DbTransaction?, bool, Func<DataOptions, DbConnection>?, Func<ConnectionOptions, IDataProvider>?, ConnectionOptionsConnectionInterceptor?, Action<MappingSchema, IEntityChangeDescriptor>?)
public ConnectionOptions(string? ConfigurationString = null, string? ConnectionString = null, IDataProvider? DataProvider = null, string? ProviderName = null, MappingSchema? MappingSchema = null, DbConnection? DbConnection = null, DbTransaction? DbTransaction = null, bool DisposeConnection = false, Func<DataOptions, DbConnection>? ConnectionFactory = null, Func<ConnectionOptions, IDataProvider>? DataProviderFactory = null, ConnectionOptionsConnectionInterceptor? ConnectionInterceptor = null, Action<MappingSchema, IEntityChangeDescriptor>? OnEntityDescriptorCreated = null)
Parameters
ConfigurationString
stringGets configuration string name to use with DataConnection instance.
ConnectionString
stringThe connection string, or
null
if a DbConnection was used instead of a connection string.DataProvider
IDataProviderGets optional IDataProvider implementation to use with connection.
ProviderName
stringGets optional provider name to use with DataConnection instance.
MappingSchema
MappingSchemaGets optional MappingSchema instance to use with DataConnection instance.
DbConnection
DbConnectionGets optional DbConnection instance to use with DataConnection instance.
DbTransaction
DbTransactionGets optional DbTransaction instance to use with DataConnection instance.
DisposeConnection
boolGets DbConnection ownership status for DataConnection instance. If
true
, DataConnection will dispose provided connection on own dispose.ConnectionFactory
Func<DataOptions, DbConnection>Gets connection factory to use with DataConnection instance. Accepts current context DataOptions settings.
DataProviderFactory
Func<ConnectionOptions, IDataProvider>Gets IDataProvider factory to use with DataConnection instance.
ConnectionInterceptor
ConnectionOptionsConnectionInterceptorConnection interceptor to support connection configuration before or right after connection opened.
OnEntityDescriptorCreated
Action<MappingSchema, IEntityChangeDescriptor>Action, called on entity descriptor creation. Allows descriptor modification. When not specified, application-wide callback EntityDescriptorCreatedCallback called.
Properties
ConfigurationString
Gets configuration string name to use with DataConnection instance.
public string? ConfigurationString { get; init; }
Property Value
ConnectionFactory
Gets connection factory to use with DataConnection instance. Accepts current context DataOptions settings.
public Func<DataOptions, DbConnection>? ConnectionFactory { get; init; }
Property Value
ConnectionInterceptor
Connection interceptor to support connection configuration before or right after connection opened.
public ConnectionOptionsConnectionInterceptor? ConnectionInterceptor { get; init; }
Property Value
ConnectionString
The connection string, or null
if a DbConnection was used instead of a connection string.
public string? ConnectionString { get; init; }
Property Value
DataProvider
Gets optional IDataProvider implementation to use with connection.
public IDataProvider? DataProvider { get; init; }
Property Value
DataProviderFactory
Gets IDataProvider factory to use with DataConnection instance.
public Func<ConnectionOptions, IDataProvider>? DataProviderFactory { get; init; }
Property Value
DbConnection
Gets optional DbConnection instance to use with DataConnection instance.
public DbConnection? DbConnection { get; init; }
Property Value
DbTransaction
Gets optional DbTransaction instance to use with DataConnection instance.
public DbTransaction? DbTransaction { get; init; }
Property Value
DisposeConnection
Gets DbConnection ownership status for DataConnection instance.
If true
, DataConnection will dispose provided connection on own dispose.
public bool DisposeConnection { get; init; }
Property Value
MappingSchema
Gets optional MappingSchema instance to use with DataConnection instance.
public MappingSchema? MappingSchema { get; init; }
Property Value
OnEntityDescriptorCreated
Action, called on entity descriptor creation. Allows descriptor modification. When not specified, application-wide callback EntityDescriptorCreatedCallback called.
public Action<MappingSchema, IEntityChangeDescriptor>? OnEntityDescriptorCreated { get; init; }
Property Value
ProviderName
Gets optional provider name to use with DataConnection instance.
public string? ProviderName { get; init; }
Property Value
Methods
Equals(ConnectionOptions?)
Indicates whether the current object is equal to another object of the same type.
public bool Equals(ConnectionOptions? other)
Parameters
other
ConnectionOptionsAn object to compare with this object.
Returns
- bool
true if the current object is equal to the
other
parameter; otherwise, false.
GetHashCode()
Serves as a hash function for a particular type.
public override int GetHashCode()