private static NuGetExpressionVisitor GetVisitor(Expression expression) { var nuGetVisitor = new NuGetExpressionVisitor(); nuGetVisitor.Visit(expression); return(nuGetVisitor); }
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); }
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); }