Exemplo n.º 1
0
        public Expression SubStringOfMethod(SubStringOfMethod method, LiteralExpression[] arguments)
        {
            if (arguments.Length == 1)
            {
                return(arguments[0]);
            }
            else
            {
                bool result;

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

                return(new LiteralExpression(result, LiteralType.Boolean));
            }
        }
        public override ICriterion SubStringOfMethod(SubStringOfMethod method, Expression[] arguments)
        {
            if (arguments[0].Type != ExpressionType.Literal)
            {
                return(base.SubStringOfMethod(method, arguments));
            }

            return(CreateLikeCriterion(arguments[1], arguments[0], MatchMode.Anywhere));
        }
 public virtual TResult SubStringOfMethod(SubStringOfMethod method, Expression[] arguments)
 {
     throw new QueryNotSupportException();
 }