Пример #1
0
        public static TeamSessionViewModel Convert(TeamSession teamSession)
        {
            TeamSessionViewModel model = new TeamSessionViewModel()
            {
                TeamId = teamSession.TeamId,
                Team   = teamSession.Team == null ? null : TeamConverter.Convert(teamSession.Team),
                LeagueSessionScheduleId = teamSession.LeagueSessionScheduleId
            };

            return(model);
        }
Пример #2
0
        public static List <TeamSessionViewModel> ConvertList(List <TeamSession> teamSessions)
        {
            return(teamSessions.Select(teamSession =>
            {
                TeamSessionViewModel model = new TeamSessionViewModel()
                {
                    TeamId = teamSession.TeamId,
                    Team = teamSession.Team == null ? null : TeamConverter.Convert(teamSession.Team),
                    LeagueSessionScheduleId = teamSession.LeagueSessionScheduleId
                };

                return model;
            }).ToList());
        }
Пример #3
0
        public static LeagueViewModel Convert(League league)
        {
            LeagueViewModel model = new LeagueViewModel();

            model.Id          = league.Id;
            model.Selected    = league.Selected;
            model.Active      = league.Active;
            model.SportTypeID = league.SportTypeID;
            model.Teams       = league.Teams == null ? null : TeamConverter.ConvertList(league.Teams);
            model.Type        = league.Type;
            model.Name        = league.Name;

            return(model);
        }
Пример #4
0
        public static List <LeagueViewModel> ConvertList(IEnumerable <League> leagues)
        {
            return(leagues.Select(league =>
            {
                LeagueViewModel model = new LeagueViewModel();
                model.Id = league.Id;
                model.Selected = league.Selected;
                model.Active = league.Active;
                model.SportTypeID = league.SportTypeID;
                model.Teams = league.Teams == null ? null : TeamConverter.ConvertList(league.Teams);
                model.Type = league.Type;
                model.Name = league.Name;

                return model;
            }).ToList());
        }