System.Data.SqlClient.SqlExceptionExtensions.IsDatabaseAvailabilityError C# (CSharp) Méthode

IsDatabaseAvailabilityError() public static méthode

Determines whether the specified exception represents a database availability error.
public static IsDatabaseAvailabilityError ( this exception ) : bool
exception this The exception.
Résultat bool
        public static bool IsDatabaseAvailabilityError(this SqlException exception)
        {
            Contract.Requires(exception != null);
            // TODO: determine the error numbers that represent the database if offline
            return exception.Class == 20;
        }