public ActionResult Dashboard() { var user = _userManager.FindById(User.Identity.GetUserId()); var assigments = _assignmentService.GetAllByUserId(user.Id); var sprints = _sprintService.SprintsForUser(user.Id); var sprintTuple = new List <Tuple <string, float, float, float, float, float> > { }; //name, to do, inprogress, readyforreview, done, all foreach (var s in sprints) { var todoList = s.Assignemnts.Where(x => x.Status.Type == StatusType.Todo); var inProgressList = s.Assignemnts.Where(x => x.Status.Type == StatusType.InProgress); var readyForReviewList = s.Assignemnts.Where(x => x.Status.Type == StatusType.ReadyForReview); var doneList = s.Assignemnts.Where(x => x.Status.Type == StatusType.Done); var allCount = s.Assignemnts.Count(x => x.Status.Type != StatusType.Backlog); sprintTuple.Add(new Tuple <string, float, float, float, float, float>( s.Name, todoList.Count(), inProgressList.Count(), readyForReviewList.Count(), doneList.Count(), allCount )); } var model = new DashboardViewModel { Assignments = assigments, User = user, BacklogCount = assigments.Count(x => x.Status.Type == StatusType.Backlog), DoneCount = assigments.Count(x => x.Status.Type == StatusType.Done), InProgressCount = assigments.Count(x => x.Status.Type == StatusType.InProgress), ReadyForReviewCount = assigments.Count(x => x.Status.Type == StatusType.ReadyForReview), ToDoCount = assigments.Count(x => x.Status.Type == StatusType.Todo), MinorCount = assigments.Count(x => x.Priority.Type == PriorityType.Minor), LowCount = assigments.Count(x => x.Priority.Type == PriorityType.Low), NormalCount = assigments.Count(x => x.Priority.Type == PriorityType.Normal), HighCount = assigments.Count(x => x.Priority.Type == PriorityType.High), CriticalCount = assigments.Count(x => x.Priority.Type == PriorityType.Criticial), TaskCount = assigments.Count(x => x.Category.Type == CategoryType.Task), BugCount = assigments.Count(x => x.Category.Type == CategoryType.Bug), ImprovmentCount = assigments.Count(x => x.Category.Type == CategoryType.Improvment), Sprints = sprintTuple, Projects = user.Projects }; return(View(model)); }