Esempio n. 1
0
        public IActionResult Index()
        {
            List <CoachViewModel> list = new List <CoachViewModel>();
            var coaches = memberQuery.GetClubCoaches(club.Guid);

            foreach (var coach in coaches)
            {
                list.Add(Map(coach));
            }

            return(View(list));
        }
Esempio n. 2
0
        public IActionResult Coach([FromRoute] string squadId)
        {
            var response = squadQuery.GetFullSquadDetails(System.Guid.Parse(squadId));
            var coaches  = memberQuery.GetClubCoaches(club.Guid);

            if (response.Coach != null)
            {
                coaches = coaches.Where(c => !c.Guid.Equals(response.Coach.Guid));
            }

            var model = new AssignCoachViewModel {
                Coaches = coaches.Select(c => new SelectListItem {
                    Text = $"{c.FirstName} {c.LastName}", Value = c.Guid.ToString()
                }).OrderBy(c => c.Text).ToList(),
                SquadId   = response.Squad.Guid,
                SquadName = response.Squad.Name
            };

            return(View(model));
        }