System.Data.SqlClient.SqlExceptionExtensions.IsDatabaseAvailabilityError C# (CSharp) Method

IsDatabaseAvailabilityError() public static method

Determines whether the specified exception represents a database availability error.
public static IsDatabaseAvailabilityError ( this exception ) : bool
exception this The exception.
return 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;
        }