コード例 #1
0
        public static Expression NotLike(this MemberExpression member, string value, bool excludeNull = false)
        {
            var expr = Expression.Not(member.Contains(value));

            if (excludeNull)
            {
                return(expr);
            }
            return(expr.OrElse(member.IsNull()));
        }
コード例 #2
0
        public static Expression Like(this MemberExpression member, string value, bool withNull = false)
        {
            var expr = member.Contains(value);

            if (!withNull)
            {
                return(expr);
            }
            return(expr.OrElse(member.IsNull()));
        }