protected override Expression VisitCollate(CollateExpression collateExpresion)
        {
            Check.NotNull(collateExpresion, nameof(collateExpresion));

            Visit(collateExpresion.Operand);

            _relationalCommandBuilder
            .Append(" COLLATE ")
            .Append(collateExpresion.Collation);

            return(collateExpresion);
        }
Esempio n. 2
0
        protected override Expression VisitCollate(CollateExpression collateExpression)
        {
            Check.NotNull(collateExpression, nameof(collateExpression));

            var parentOptimize = _optimize;

            _optimize = false;
            var operand = (SqlExpression)Visit(collateExpression.Operand);

            _optimize = parentOptimize;

            return(ApplyConversion(collateExpression.Update(operand), condition: false));
        }
Esempio n. 3
0
        public virtual SqlExpression ApplyTypeMapping(SqlExpression sqlExpression, RelationalTypeMapping typeMapping)
        {
            if (sqlExpression == null ||
                sqlExpression.TypeMapping != null)
            {
                return(sqlExpression);
            }

            return(sqlExpression switch
            {
                CaseExpression e => ApplyTypeMappingOnCase(e, typeMapping),
                CollateExpression e => ApplyTypeMappingOnCollate(e, typeMapping),
                LikeExpression e => ApplyTypeMappingOnLike(e),
                SqlBinaryExpression e => ApplyTypeMappingOnSqlBinary(e, typeMapping),
                SqlUnaryExpression e => ApplyTypeMappingOnSqlUnary(e, typeMapping),
                SqlConstantExpression e => e.ApplyTypeMapping(typeMapping),
                SqlFragmentExpression e => e,
                SqlFunctionExpression e => e.ApplyTypeMapping(typeMapping),
                SqlParameterExpression e => e.ApplyTypeMapping(typeMapping),
                _ => sqlExpression
            });
Esempio n. 4
0
        /// <inheritdoc />
        public virtual SqlExpression ApplyTypeMapping(SqlExpression sqlExpression, RelationalTypeMapping typeMapping)
        {
#pragma warning disable IDE0046 // Convert to conditional expression
            if (sqlExpression == null
#pragma warning restore IDE0046 // Convert to conditional expression
                || sqlExpression.TypeMapping != null)
            {
                return(sqlExpression);
            }

            return(sqlExpression switch
            {
                CaseExpression e => ApplyTypeMappingOnCase(e, typeMapping),
                CollateExpression e => ApplyTypeMappingOnCollate(e, typeMapping),
                LikeExpression e => ApplyTypeMappingOnLike(e),
                SqlBinaryExpression e => ApplyTypeMappingOnSqlBinary(e, typeMapping),
                SqlUnaryExpression e => ApplyTypeMappingOnSqlUnary(e, typeMapping),
                SqlConstantExpression e => e.ApplyTypeMapping(typeMapping),
                SqlFragmentExpression e => e,
                SqlFunctionExpression e => e.ApplyTypeMapping(typeMapping),
                SqlParameterExpression e => e.ApplyTypeMapping(typeMapping),
                _ => sqlExpression
            });
Esempio n. 5
0
 /// <summary>
 ///     Visits the children of the collate expression.
 /// </summary>
 /// <param name="collateExpression"> The expression to visit. </param>
 /// <returns> The modified expression, if it or any subexpression was modified; otherwise, returns the original expression. </returns>
 protected abstract Expression VisitCollate([NotNull] CollateExpression collateExpression);
Esempio n. 6
0
 /// <summary>
 ///     Visits the children of the collate expression.
 /// </summary>
 /// <param name="collateExpression"> The expression to visit. </param>
 /// <returns> The modified expression, if it or any subexpression was modified; otherwise, returns the original expression. </returns>
 protected abstract Expression VisitCollate(CollateExpression collateExpression);
Esempio n. 7
0
 public virtual void Visit(CollateExpression node)
 {
     VisitInternal(node.StringValue);
 }
Esempio n. 8
0
 public void Visit(CollateExpression node)
 {
     VisitChild(2, false, false, node.StringValue);
 }
 protected override Expression VisitCollate([NotNullAttribute] CollateExpression collateExpression)
 {
     throw new NotImplementedException();
 }