using System.Collections.Generic; using Microsoft.DotNet.ProjectModel; using MultiProjectValidator.AnalysisRules; namespace MultiProjectValidator { public class ProjectAnalyzer { public static ProjectAnalyzer Create(List projectContexts) { // Any Additional rules would be added here var rules = new List { new DependencyMismatchRule() }; return new ProjectAnalyzer(rules, projectContexts); } private List _projectContexts; private List _rules; private ProjectAnalyzer(List rules, List projectContexts) { _rules = rules; _projectContexts = projectContexts; } public List DoAnalysis() { var results = new List(); foreach(var rule in _rules) { results.Add(rule.Evaluate(_projectContexts)); } return results; } } }