コード例 #1
0
        public UserGameView GetUserGame(int gameId, int userId)
        {
            var usergame = userGames.GetUserGame(gameId, userId);
            var game     = games.GetGame(usergame.GameId);
            var genre    = games.GetGenre(game.GenreId).Name;

            return(mappingService.GetUserGameView(game, genre, usergame));
        }
コード例 #2
0
        public IEnumerable <GameView> GetAllGames(string query)
        {
            var             gamesDetails = games.GetGames(query);
            List <GameView> gameDtos     = new List <GameView>();

            foreach (var game in gamesDetails)
            {
                var genre = games.GetGenre(game.GenreId).Name;
                gameDtos.Add(mappingService.GetGameViewFromGame(game, genre));
            }
            return(gameDtos);
        }