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)); }
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)); }