private MySQLCollateExpression ApplyTypeMappingOnCollate(MySQLCollateExpression collateExpression)
        {
            var inferredTypeMapping = ExpressionExtensions.InferTypeMapping(collateExpression.ValueExpression)
                                      ?? _typeMappingSource.FindMapping(collateExpression.ValueExpression.Type);

            return(new MySQLCollateExpression(
                       ApplyTypeMapping(collateExpression.ValueExpression, inferredTypeMapping),
                       collateExpression.Charset,
                       collateExpression.Collation,
                       inferredTypeMapping ?? collateExpression.TypeMapping));
        }
示例#2
0
        public Expression VisitMySQLCollateExpression(MySQLCollateExpression mySqlCollateExpression)
        {
            Check.NotNull(mySqlCollateExpression, nameof(mySqlCollateExpression));

            Sql.Append("CONVERT(");

            Visit(mySqlCollateExpression.ValueExpression);

            Sql.Append($" USING {mySqlCollateExpression.Charset}) COLLATE {mySqlCollateExpression.Collation}");

            return(mySqlCollateExpression);
        }