Exemple #1
0
        public UserView GetUserProfile(int userId)
        {
            var user          = userProfiles.GetUserProfile(userId);
            var userExchanges = exchanges.GetUserExchanges(userId);

            userExchanges = userExchanges.Where(e => e.State != ExchangeState.Declined && e.State != ExchangeState.Waiting).ToArray();
            var comments = userProfiles.GetComments(userId);

            return(mappingService.GetUserViewFromUser(user, comments, userExchanges.Count()));
        }
        public IEnumerable <GameAndUserView> GetUserGamesByGame(int gameId)
        {
            var gamePieces = userGames.GetUserGamesByGame(gameId);
            List <GameAndUserView> gameViews = new List <GameAndUserView>();

            foreach (var game in gamePieces)
            {
                var userProfile = userProfiles.GetUserProfile(game.UserId);
                var comments    = userProfiles.GetComments(game.UserId);
                var gameCopy    = games.GetGame(game.GameId);
                gameViews.Add(mappingService.GetGameAndUserView(gameCopy, game, userProfile, comments));
            }
            return(gameViews);
        }