Пример #1
0
        public override Func <TwitterStatus, IReadOnlyCollection <long> > GetSetValueProvider()
        {
            var lsp = LeftValue.GetSetValueProvider();
            var rsp = RightValue.GetSetValueProvider();

            return(_ => lsp(_).Except(rsp(_)).ToList());
        }
Пример #2
0
        public override Func <TwitterStatus, bool> GetBooleanValueProvider()
        {
            if (CompareAsString())
            {
                var haystack = LeftValue.GetStringValueProvider();
                var needle   = RightValue.GetStringValueProvider();
                return(t =>
                {
                    var h = haystack(t);
                    var n = needle(t);
                    if (h == null || n == null)
                    {
                        return false;
                    }
                    return h.IndexOf(n, GetStringComparison()) >= 0;
                });
            }
            var lsp = LeftValue.GetSetValueProvider();

            if (RightValue.SupportedTypes.Contains(FilterExpressionType.Numeric))
            {
                var rnp = RightValue.GetNumericValueProvider();
                return(_ => lsp(_).Contains(rnp(_)));
            }
            var rsp = RightValue.GetSetValueProvider();

            return(_ =>
            {
                var ls = lsp(_);
                return rsp(_).Any(ls.Contains);
            });
        }
Пример #3
0
        public override Func <TwitterStatus, bool> GetBooleanValueProvider()
        {
            var rsp = RightValue.GetSetValueProvider();

            if (LeftValue.SupportedTypes.Contains(FilterExpressionType.Numeric))
            {
                var lnp = LeftValue.GetNumericValueProvider();
                return(_ => rsp(_).Contains(lnp(_)));
            }
            var lsp = LeftValue.GetSetValueProvider();

            return(_ =>
            {
                var rs = rsp(_);
                return lsp(_).Any(rs.Contains);
            });
        }