public virtual ActionResult Search(string q)
        {
            var packageValidationSets = _validationAdminService.Search(q ?? string.Empty);

            // Sort by lexigraphically package ID then put newer stuff on top.
            var groups = packageValidationSets
                         .OrderBy(x => x.PackageId)
                         .ThenByDescending(x => NuGetVersion.Parse(x.PackageNormalizedVersion))
                         .ThenByDescending(x => x.PackageKey)
                         .ThenByDescending(x => x.Created)
                         .ThenByDescending(x => x.Key)
                         .GroupBy(x => x.PackageKey);

            var validatedPackages = new List <ValidatedPackageViewModel>();

            foreach (var group in groups)
            {
                foreach (var set in group)
                {
                    // Put completed validations first then put new validations on top.
                    set.PackageValidations = set.PackageValidations
                                             .OrderByDescending(x => x.ValidationStatus)
                                             .ThenByDescending(x => x.ValidationStatusTimestamp)
                                             .ToList();
                }

                var deletedStatus    = _validationAdminService.GetPackageDeletedStatus(group.Key);
                var validatedPackage = new ValidatedPackageViewModel(group.ToList(), deletedStatus);
                validatedPackages.Add(validatedPackage);
            }

            return(View(nameof(Index), new ValidationPageViewModel(q, validatedPackages)));
        }
        public virtual ActionResult Search(string q)
        {
            var packageValidationSets = _validationAdminService.Search(q ?? string.Empty);
            var validatedPackages     = ToPackageValidations(packageValidationSets);

            return(View(nameof(Index), new ValidationPageViewModel(q, validatedPackages)));
        }
Пример #3
0
        public virtual ActionResult Search(string q)
        {
            var packageValidationSets = _validationAdminService.Search(q ?? string.Empty);
            var validatedPackages     = new List <ValidatedPackageViewModel>();

            AppendValidatedPackages(validatedPackages, packageValidationSets, ValidatingType.Package);
            AppendValidatedPackages(validatedPackages, packageValidationSets, ValidatingType.SymbolPackage);

            return(View(nameof(Index), new ValidationPageViewModel(q, validatedPackages)));
        }