Search Results for

    Show / Hide Table of Contents
    View Source

    Class DbConnectionExtensions

    Contains extension methods for System.Data.Common.DbConnection to extend database connection capabilities.

    Inheritance
    object
    Namespace: Umbraco.Extensions
    Assembly: Umbraco.Infrastructure.dll
    Syntax
    public static class DbConnectionExtensions

    Methods

    View Source

    IsAvailable(IDbConnection)

    Checks whether the specified database connection is available by attempting to open and close it.

    Declaration
    public static bool IsAvailable(this IDbConnection connection)
    Parameters
    Type Name Description
    IDbConnection connection

    The System.Data.IDbConnection to test for availability.

    Returns
    Type Description
    bool

    true if the connection can be opened and closed without throwing a System.Data.Common.DbException; otherwise, false.

    View Source

    IsConnectionAvailable(string?, DbProviderFactory?)

    Determines whether a database connection can be successfully opened using the specified connection string and provider factory.

    Declaration
    public static bool IsConnectionAvailable(string? connectionString, DbProviderFactory? factory)
    Parameters
    Type Name Description
    string connectionString

    The connection string used to establish the database connection.

    DbProviderFactory factory

    The database provider factory used to create the connection.

    Returns
    Type Description
    bool

    True if the connection is available and can be opened; otherwise, false.

    • View Source
    In this article
    Back to top Copyright © 2016-present Umbraco
    Generated by DocFX