public async Task <IActionResult> GetTeams() { try { var teams = await _teamRepository.GetAll(); var teamListHierarchy = new List <Employee>(); foreach (var team in teams) { if (!team.BossId.HasValue) { await _teamControllerService.GetAllTeams(team, teamListHierarchy); } } List <TeamResponseModel> teamResponseModel = _mapper.Map <List <TeamResponseModel> >(teamListHierarchy); return(Ok(teamResponseModel)); } catch (Exception e) { return(BadRequest(e.Message)); } }
public ActionResult Index() { var vmTeams = _teamControllerService.GetAllTeams(); return(View(vmTeams)); }