public override ICriterion EndsWithMethod(EndsWithMethod method, Expression[] arguments)
        {
            if (arguments[1].Type != ExpressionType.Literal)
            {
                return(base.EndsWithMethod(method, arguments));
            }

            return(CreateLikeCriterion(arguments[0], arguments[1], MatchMode.End));
        }
Exemple #2
0
        public Expression EndsWithMethod(EndsWithMethod method, LiteralExpression[] arguments)
        {
            bool result;

            if (LiteralUtil.IsAnyNull(arguments))
            {
                result = false;
            }
            else
            {
                result = LiteralUtil.CoerceString(arguments[0]).EndsWith(
                    LiteralUtil.CoerceString(arguments[1]),
                    StringComparison.InvariantCultureIgnoreCase
                    );
            }

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