/// <summary> /// Assigns the release artifact list. /// </summary> /// <param name="presenter">The presenter.</param> /// <param name="artifactList">The artifact list.</param> private static void AssignReleaseArtifactList(ProjectDashboardPresenter presenter, IList<ProcessComplianceListItem> artifactList) { var nodeIndexRelease = 0; var groupedListRelease = artifactList.OrderBy(a => a.Squence) .Where(a => a.ArtifactType == (byte)ArtifactType.Release) .GroupBy(u => new { buiildNumber = u.BuildNumber, prefix = u.Prefix, releaseType = u.Environment, releaseDate = u.StartDate, calendarId = u.ReleaseCalendarID, releaseStatus = u.ReleaseStatus, releaseEndDate = u.EndDate }) .Select(grp => new ProcessComplianceListItem { BuildNumber = grp.Key.buiildNumber, Prefix = grp.Key.prefix, ReleaseCalendarID = grp.Key.calendarId, Environment = grp.Key.releaseType, StartDate = grp.Key.releaseDate, Items = grp.ToList(), ReleaseStatus = grp.Key.releaseStatus, EndDate = grp.Key.releaseEndDate }) .OrderByDescending(g => g.StartDate) .ToList(); groupedListRelease.ForEach(g => { g.NodeIndex = nodeIndexRelease; nodeIndexRelease++; }); groupedListRelease.ForEach(g => { g.IsReleaseWithNoArtifact = g.Items.Any(u => u.ArtifactID == null); }); presenter.AssignReleaseArtifactList(groupedListRelease); (from artifact in presenter.ReleaseArtifactList from releaseType in presenter.ReleaseTypeList where artifact.Environment == releaseType.ID select MapProcessComplianceEnvironmentTitle(releaseType, artifact)).ToList(); presenter.ReleaseArtifactList.Where(a => a.Environment != InternalEnvironment).GroupBy(u => u.Environment).ForEach(AssignReleaseStatus); }