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

            return(CreateLikeCriterion(arguments[0], arguments[1], MatchMode.Start));
        }
Example #2
0
        public Expression StartsWithMethod(StartsWithMethod method, LiteralExpression[] arguments)
        {
            bool result;

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

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