private static NuGetQueryFilter GetFilter(NuGetExpressionVisitor nuGetVisitor)
        {
            var filter = nuGetVisitor.GetNuGetQueryFilter();

            var validator = NuGetQueryValidator.ValidateFilter(filter);

            if (!validator.IsValid)
            {
                throw new Exception(string.Join(Environment.NewLine, validator.Errors.Select(err => err.Message)));
            }

            return(filter);
        }
Ejemplo n.º 2
0
        internal static IAsyncQueryable <NuGetPackage> Execute(Expression expression, NuGetRepository nuGetRepository, Expression root)
        {
            var nuGetVisitor = new NuGetExpressionVisitor();

            var visitedExpression = nuGetVisitor.Visit(expression);

            var filter = nuGetVisitor.GetNuGetQueryFilter();

            var queryableElements = Materialize(nuGetRepository, filter);

            if (filter.SyncIncompatibility)
            {
                return(Synchronized(queryableElements, nuGetVisitor.GetNotEvaluated));
            }

            return(queryableElements);
        }