public async Task <GameListHistoryView> GetGamesByPlayerId(int playerId)
        {
            List <Game> games = await _gameRepository.GetGamesByPlayerId(playerId);

            GameListHistoryView data = new GameListHistoryView();

            data.Player = _maping.MapPlayerToPlayerGameListHistoryViewItem(await _playerRepository.Get(playerId));
            data.Games  = _maping.MapGamesToGameGameListHistoryViewItem(games);

            return(data);
        }
Example #2
0
        public async Task <GameListHistoryView> GetGamesByPlayerId(int playerId)
        {
            try
            {
                GameListHistoryView model = await _historyService.GetGamesByPlayerId(playerId);

                return(model);
            }
            catch (Exception ex)
            {
                logger.Error(ex.ToString());
                throw;
            }
        }