private void AddIssuesToViewModel(GlimpsePackage packageIssue, PackageCategoryViewModel packageCategory) { var openIssues = packageIssue.Issues.Where(p => p.Status == GithubIssueStatus.Open).ToList(); var closedIssues = packageIssue.Issues.Where(p => p.Status == GithubIssueStatus.Closed).ToList(); AddToIssueViewModel(openIssues, packageCategory.AcknowledgedIssues); AddToIssueViewModel(closedIssues, packageCategory.CompletedIssues); }
private PackageCategoryViewModel GetOrCreatePackageCategoryViewModel(IssuesIndexViewModel issuesView, GlimpsePackage packageIssue) { var packageCategory = issuesView.PackageCategories.FirstOrDefault(c => c.Name == packageIssue.Category); if (packageCategory == null) { packageCategory = new PackageCategoryViewModel { Name = packageIssue.Category }; issuesView.PackageCategories.Add(packageCategory); } return packageCategory; }