Table of Contents

Method EnsureOpen

Namespace
Open.Database.Extensions
Assembly
Open.Database.Extensions.Core.dll

EnsureOpen(IDbConnection)

If the connection isn't open, opens the connection.
If the connection is in neither open or close, first closes the connection, then opens it.

public static ConnectionState EnsureOpen(this IDbConnection connection)

Parameters

connection IDbConnection

The connection to transact with.

Returns

ConnectionState

The prior connection state.