Пример #1
0
        /// <summary>
        /// This is the entry point for solving the original problem:
        /// - Detect all type and member references to a particular assembly.
        /// - Detect all differences between two versions of that assembly.
        /// - Find the intersection.
        /// </summary>
        public static IEnumerable <DetectedCompatibilityIssue> DetectCompatibilityIssues(
            CompatiblityIssueCollector collector,
            AssemblyDefinition main,
            AssemblyDefinition dependency,
            AssemblyDefinition dependencyHigherVersion)
        {
            var references = GetAllReferences(main)
                             .Where(reference => reference.RefersIn(dependency))
                             .ToList();

            var issues = collector.GetCompatibilityIssuesBetween(dependency, dependencyHigherVersion)
                         .ToList();

            return(from issue in issues
                   let locations = DetectIssue(issue, references).ToList()
                                   where locations.Count != 0
                                   select new DetectedCompatibilityIssue(issue, locations));
        }