コード例 #1
0
        public static GameTimeViewModel Convert(GameTime gameTime)
        {
            GameTimeViewModel model = new GameTimeViewModel();

            model.GamesTime = (Int64)DateTime.UtcNow.Subtract(DateTime.UnixEpoch).TotalSeconds;
            model.GameDayId = gameTime.GameDayId;
            model.Id        = gameTime.Id;

            return(model);
        }
コード例 #2
0
        public static List <GameTimeViewModel> ConvertList(IEnumerable <GameTime> gameTimes)
        {
            return(gameTimes.Select(gameTime =>
            {
                GameTimeViewModel model = new GameTimeViewModel();
                model.GamesTime = (Int64)DateTime.UtcNow.Subtract(DateTime.UnixEpoch).TotalSeconds;
                model.Id = gameTime.Id;
                model.GameDayId = gameTime.GameDayId;

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