Esempio n. 1
0
        public bool Match(ITemplateInfo source, QueryablePropertyDictionary context)
        {
            var itemQuery = Items
                            .Where(i => !i.IsContext)
                            .ToList();
            var contextQuery = Items
                               .Where(i => i.IsContext)
                               .ToList();

            var itemResult    = Match(itemQuery, source);
            var contextResult = !contextQuery.Any();

            if (itemResult && context != null)
            {
                contextResult = Match(contextQuery, context);
            }

            return(itemResult && contextResult);
        }
Esempio n. 2
0
 private static bool Match(IEnumerable <QueryNode> query, QueryablePropertyDictionary queryableProperties)
 {
     return(query
            .All(q => queryableProperties.SafeGet(q.Field).Compare(q)));
 }