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)); }
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); }