Пример #1
0
        public static GameDayViewModel Convert(GameDay gameDay)
        {
            GameDayViewModel model = new GameDayViewModel();

            model.GamesDay = gameDay.GamesDay;
            model.Id       = gameDay.Id;
            model.LeagueSessionScheduleId = gameDay.LeagueSessionScheduleId;
            model.GamesTimes = GameTimeConverter.ConvertList(gameDay.GamesTimes);

            return(model);
        }
Пример #2
0
        public static List <GameDayViewModel> ConvertList(IEnumerable <GameDay> gameDays)
        {
            return(gameDays.Select(gameDay =>
            {
                GameDayViewModel model = new GameDayViewModel();
                model.GamesDay = gameDay.GamesDay;
                model.Id = gameDay.Id;
                model.LeagueSessionScheduleId = gameDay.LeagueSessionScheduleId;
                model.GamesTimes = GameTimeConverter.ConvertList(gameDay.GamesTimes);

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