Skip to content

ColumnExists returns false in a catch! #118

@JaBistDuNarrisch

Description

@JaBistDuNarrisch

Wrong:

    public virtual bool ColumnExists(string table, string column, bool ignoreCase)
    {
        try
        {
            if (ignoreCase)
            {
                return GetColumns(table).Any(col => col.Name.ToLower() == column.ToLower());
            }

            return GetColumns(table).Any(col => col.Name == column);
        }
        catch (Exception)
        {
            return false;
        }
    }

The exception could be thrown of any reason not just because the column does not exist. Major bug!

Metadata

Metadata

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions