Example #1
0
 public override IProjection ReplaceMethod(ReplaceMethod method, Expression[] arguments)
 {
     return(new SqlFunctionProjection(
                "replace",
                NHibernateUtil.String,
                ProjectionVisitor.CreateProjection(arguments[0]),
                ProjectionVisitor.CreateProjection(arguments[1]),
                ProjectionVisitor.CreateProjection(arguments[2])
                ));
 }
Example #2
0
        public Expression ReplaceMethod(ReplaceMethod method, LiteralExpression[] arguments)
        {
            if (LiteralUtil.IsAnyNull(arguments))
            {
                return(new LiteralExpression(null, LiteralType.Null));
            }
            else
            {
                string result = LiteralUtil.CoerceString(arguments[0]).Replace(
                    LiteralUtil.CoerceString(arguments[1]),
                    LiteralUtil.CoerceString(arguments[2])
                    );

                return(new LiteralExpression(result, LiteralType.String));
            }
        }
 public virtual TResult ReplaceMethod(ReplaceMethod method, Expression[] arguments)
 {
     throw new QueryNotSupportException();
 }