Repository: dotnet/efcore
File: src/EFCore.Relational/Query/QuerySqlGenerator.cs (C#)

Code before:

        if (negated)
        {
            _relationalCommandBuilder.Append(" NOT");
        }

        _relationalCommandBuilder.Append(" LIKE ");

        Visit(likeExpression.Pattern);

        if (likeExpression.EscapeChar != null)
        {
            _relationalCommandBuilder.Append(" ESCAPE ");
            Visit(likeExpression.EscapeChar);
        }
    }

    /// <summary>
    ///     Generates SQL for a COLLATE expression.
    /// </summary>
    /// <param name="collateExpression">The <see cref="CollateExpression" /> for which to generate SQL.</param>
    protected override Expression VisitCollate(CollateExpression collateExpression)
    {
        Visit(collateExpression.Operand);

        // In some databases (e.g. SQL Server), collations aren't regular identifirs (like column or table names), and so shouldn't be
        // quoted. However, we still default to quoting to prevent cases where arbitrary collation name inputs get integrated into the SQL.
        // Providers which don't supporting quoting of collation names should override this method to provide sanitization logic,
        // e.g. throwing if the name contains any but a restricted set of characters.
        _relationalCommandBuilder
            .Append(" COLLATE ")
            .Append(_sqlGenerationHelper.DelimitIdentifier(collateExpression.Collation));

        return collateExpression;
    }

    /// <summary>
    ///     Generates SQL for a DISTINCT () clause in an aggregate function invocation.
    /// </summary>
    /// <param name="distinctExpression">The <see cref="DistinctExpression" /> for which to generate SQL.</param>
    protected override Expression VisitDistinct(DistinctExpression distinctExpression)
    {
        _relationalCommandBuilder.Append("DISTINCT (");
        Visit(distinctExpression.Operand);
        _relationalCommandBuilder.Append(")");

        return distinctExpression;
    }

    /// <summary>
    ///     Generates SQL for a CASE clause CASE/WHEN construct.

Review comment (suggestion):
Spelling error: "identifirs" should be "identifiers".
```suggestion
        // In some databases (e.g. SQL Server), collations aren't regular identifiers (like column or table names), and so shouldn't be
```

Code after:

        if (negated)
        {
            _relationalCommandBuilder.Append(" NOT");
        }

        _relationalCommandBuilder.Append(" LIKE ");

        Visit(likeExpression.Pattern);

        if (likeExpression.EscapeChar != null)
        {
            _relationalCommandBuilder.Append(" ESCAPE ");
            Visit(likeExpression.EscapeChar);
        }
    }

    /// <summary>
    ///     Generates SQL for a COLLATE expression.
    /// </summary>
    /// <param name="collateExpression">The <see cref="CollateExpression" /> for which to generate SQL.</param>
    protected override Expression VisitCollate(CollateExpression collateExpression)
    {
        Visit(collateExpression.Operand);

        // In some databases (e.g. SQL Server), collations aren't regular identifiers (like column or table names), and so shouldn't be
        // quoted. However, we still default to quoting to prevent cases where arbitrary collation name inputs get integrated into the SQL.
        // Providers which don't support quoting of collation names should override this method to provide sanitization logic,
        // e.g. throwing if the name contains any but a restricted set of characters.
        _relationalCommandBuilder
            .Append(" COLLATE ")
            .Append(_sqlGenerationHelper.DelimitIdentifier(collateExpression.Collation));

        return collateExpression;
    }

    /// <summary>
    ///     Generates SQL for a DISTINCT () clause in an aggregate function invocation.
    /// </summary>
    /// <param name="distinctExpression">The <see cref="DistinctExpression" /> for which to generate SQL.</param>
    protected override Expression VisitDistinct(DistinctExpression distinctExpression)
    {
        _relationalCommandBuilder.Append("DISTINCT (");
        Visit(distinctExpression.Operand);
        _relationalCommandBuilder.Append(")");

        return distinctExpression;
    }

    /// <summary>
    ///     Generates SQL for a CASE clause CASE/WHEN construct.