Пример #1
0
        internal DependentSolution(
            ISolution s,
            IReadOnlyList <Row> dependencyTable,
            Func <ISolution, DependentSolution> others)
        {
            Solution     = s;
            Requirements = dependencyTable.Where(r => r.Solution == s && r.Target != null)
                           .Select(r => r.Target.Solution)
                           .Distinct()
                           .Select(others)
                           .ToList();

            MinimalRequirements = Requirements.Except(Requirements.SelectMany(r => r.MinimalRequirements)).ToList();
            Rank = MinimalRequirements.Count == 0 ? 0 : MinimalRequirements.Max(r => r.Rank) + 1;
            TransitiveRequirements = Requirements.SelectMany(r => r.TransitiveRequirements).Distinct().ToList();

            PublishedRequirements = dependencyTable.Where(r => r.Solution == s &&
                                                          r.Target != null &&
                                                          r.Origin.IsPublished)
                                    .Select(r => r.Target.Solution)
                                    .Distinct()
                                    .Select(others)
                                    .ToList();
        }