public Expression ConcatMethod(ConcatMethod method, LiteralExpression[] arguments) { if (arguments.Length == 1) { return(arguments[0]); } else if (arguments[0].LiteralType == LiteralType.Null) { if (arguments[1].LiteralType == LiteralType.Null) { return(new LiteralExpression(null, LiteralType.Null)); } else { return(arguments[1]); } } else if (arguments[1].LiteralType == LiteralType.Null) { return(arguments[0]); } else { string result = LiteralUtil.CoerceString(arguments[0]) + LiteralUtil.CoerceString(arguments[1]); return(new LiteralExpression(result, LiteralType.String)); } }
public override IProjection ConcatMethod(ConcatMethod method, Expression[] arguments) { if (arguments.Length == 1) { return(ProjectionVisitor.CreateProjection(arguments[0])); } else { return(new SqlFunctionProjection( "concat", NHibernateUtil.String, ProjectionVisitor.CreateProjection(arguments[0]), ProjectionVisitor.CreateProjection(arguments[1]) )); } }
public virtual TResult ConcatMethod(ConcatMethod method, Expression[] arguments) { throw new QueryNotSupportException(); }