public ActionResult RepoBuilds(string id)
        {
            ViewBag.GUID = id;

            // Now build the tab model for the partial view
            // Grab the build definitions for the selected REPO ID/GUID

            var builds = GetBuildDefinition(id);

            var items = new List <BuildTabVM>();

            // Now one at a time go through and pull out NAME and ID for the model
            Parallel.ForEach(builds, new ParallelOptions {
                MaxDegreeOfParallelism = 1
            }, build =>
            {
                var b = new BuildTabVM()
                {
                    Comment        = build.Comment,
                    Id             = build.Id,
                    Name           = build.Name,
                    RepositoryGuid = build.Repository.Id
                };
                items.Add(b);
            });

            return(PartialView(items));
        }
Example #2
0
        public ActionResult RepoReleases(string id)
        {
            ViewBag.GUID = id;

            var builds = GetBuildDefinition(id);
            List <Classes.VSTS.VstsReleaseDefinition> items = new List <Classes.VSTS.VstsReleaseDefinition>();

            // Now that I have the builds definitions for the selected REPO, I need to search each
            // found build to associate the a "found" release

            //Parallel.ForEach(builds, new ParallelOptions { MaxDegreeOfParallelism = 1 }, build =>
            foreach (var build in builds)
            {
                // Find the releases with the same BUILD.ID
                var defs = GetReleaseDefinitionOnBuildId(build.Id);
                if (defs.Count > 0)
                {
                    items.AddRange(defs);
                }
            }//);

            var tabs = new List <BuildTabVM>();

            // Now one at a time go through and pull out NAME and ID for the model
            //Parallel.ForEach(items, new ParallelOptions { MaxDegreeOfParallelism = 1 }, item =>
            foreach (var item in items)
            {
                var b = new BuildTabVM()
                {
                    Comment = item.Description,
                    Id      = item.Id,
                    Name    = item.Name
                };
                tabs.Add(b);
            }//);

            return(PartialView(tabs));
        }