Beispiel #1
0
        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));
            }
        }
Beispiel #2
0
        public ActionResult Index()
        {
            var vmTeams = _teamControllerService.GetAllTeams();

            return(View(vmTeams));
        }