public async Task <IActionResult> Index(int?id)
        {
            int teamId = userSessionHelper.TeamId;
            var vm     = new DashBoardVM {
            };

            if (id != null)
            {
                var team = teamManager.GetTeam(id.Value);
                if (team != null && team.IsPublic)
                {
                    teamId = id.Value;
                }
                userSessionHelper.SetTeamId(id.Value);
                await userAccountManager.SetDefaultTeam(userSessionHelper.UserId, id.Value);
            }

            var issues = this.issueManager.GetIssuesGroupedByStatusGroup(teamId, 25).SelectMany(f => f.Issues).ToList();

            vm.RecentIssues = issues;

            vm.Projects = this.projectManager.GetProjects().ToList();

            return(View(vm));
        }
        public async Task <IActionResult> SwitchTeam(int teamId)
        {
            userSessionHelper.SetTeamId(teamId);
            await userAccountManager.SetDefaultTeam(userSessionHelper.UserId, teamId);

            return(Json("Changed"));
        }
        // GET: /<controller>/
        //[Route("~/Dashboard/{id}")]
        public async Task <IActionResult> Index(int?id)
        {
            var vm = new DashBoardVM {
            };

            if (id != null)
            {
                userSessionHelper.SetTeamId(id.Value);
                await userAccountManager.SetDefaultTeam(userSessionHelper.UserId, id.Value);
            }
            return(View(vm));
        }