Esempio n. 1
0
 public static IEnumerable <TeamMemberViewModel> Players(this TeamViewModel team)
 {
     return(team.Members?.Where(x => x.Role == MemberRole.Player));
 }
Esempio n. 2
0
 public static bool HasSelectedPlayer(this TeamViewModel team, int id)
 {
     return(team.SelectedPlayerIds.Any(x => x == id));
 }
Esempio n. 3
0
 public static bool HasPlayer(this TeamViewModel team, int id)
 {
     return(team.Players().Any(x => x.Id == id));
 }
Esempio n. 4
0
 public static TeamMemberViewModel Manager(this TeamViewModel team)
 {
     return(team.Members?.FirstOrDefault(x => x.Role == MemberRole.Manager));
 }
Esempio n. 5
0
 public static string ImageUrlOrNoTeam(this TeamViewModel team, UrlHelper urlHelper)
 {
     return(urlHelper.Content(team.ImageUrl ?? "~/content/img/teams/no-team.png"));
 }
Esempio n. 6
0
 public static string ImageUrlOrDefault(this TeamViewModel team, UrlHelper urlHelper)
 {
     return(urlHelper.Content(team.ImageUrl ?? $"~/content/img/teams/{team.Name.ToLower().Replace(" ", "-")}.png"));
 }