Table of Contents

Class SqlServerConnectionFactory

Namespace
Fdyay.IdentityServer.Dapper.Sql
Assembly
Fdyay.IdentityServer.Dapper.dll

Opens SQL Server connections.

public sealed class SqlServerConnectionFactory : IDbConnectionFactory
Inheritance
SqlServerConnectionFactory
Implements
Inherited Members

Constructors

SqlServerConnectionFactory(string)

Creates a factory that opens connections with connectionString.

public SqlServerConnectionFactory(string connectionString)

Parameters

connectionString string

The SQL Server connection string. Held as given; nothing connects until OpenConnectionAsync(CancellationToken) is called.

Exceptions

ArgumentException

connectionString is null or empty.

Properties

Dialect

The SQL dialect for the configured provider.

public ISqlDialect Dialect { get; }

Property Value

ISqlDialect

Remarks

Always a SqlServerDialect.

Methods

OpenConnectionAsync(CancellationToken)

Opens a new connection.

public Task<DbConnection> OpenConnectionAsync(CancellationToken cancellationToken = default)

Parameters

cancellationToken CancellationToken

Returns

Task<DbConnection>

Remarks

A new SqlConnection per call, already open; the caller disposes it, and pooling is the provider's.