Archon.Data.ExceptionTypeExtensions.IsDuplicateKeyException C# (CSharp) Method

IsDuplicateKeyException() public static method

public static IsDuplicateKeyException ( this ex ) : bool
ex this
return bool
        public static bool IsDuplicateKeyException(this SqlException ex)
        {
            if (ex == null)
                return false;

            if (ex.Message == null)
                return false;

            return ex.Message.Contains("duplicate key");
        }
ExceptionTypeExtensions