public ActionResult ById(int?id) { var issue = id.HasValue ? IssueController.GetById(id.Value) : null; if (issue == null) { return(RedirectToAction("Index")); } return(View(issue)); }
public ActionResult Category(int?id) { var categoryList = LayoutHelper.GetCategories(); var category = id.HasValue ? categoryList.FirstOrDefault(cat => cat.Id == id.Value) : null; if (category == null) { return(RedirectToAction("Index")); } var issues = IssueController.InternalGetIssues(0, -1, category.Id); return(View(new CategryIssues(issues.Data) { Category = category, Total = issues.TotalCount })); }