public Expression VisitSqlColumnExpression (SqlColumnExpression expression)
{
// We always need to convert boolean columns to int columns because in the database, the column is represented as a bit (integer) value
if (BooleanUtility.IsBooleanType (expression.Type))
{
var intType = BooleanUtility.GetMatchingIntType (expression.Type);
Expression convertedExpression = expression.Update (intType, expression.OwningTableAlias, expression.ColumnName, expression.IsPrimaryKey);
return new SqlConvertedBooleanExpression (convertedExpression);
}
return expression; // rely on VisitExpression to apply correct semantics
}