Example #1
0
        public ScoreDTO GetUserScoresByName(string user)
        {
            ScoreDTO          scoreDTO   = new ScoreDTO();
            List <PlayerStat> returnList = scoreDAO.GetUserScoresByName(user);

            scoreDTO.ErrorCode = returnList.Count > 0 ? 0 : -1;
            scoreDTO.ErrorMsg  = returnList.Count > 0 ? "OK" : $"User '{user}' Does Not Exist Or Does Not Have Scores";
            scoreDTO.Scores    = returnList.Count > 0 ? returnList : null;
            return(scoreDTO);
        }
Example #2
0
        public ScoreDTO GetAllScores()
        {
            ScoreDTO          scoreDTO   = new ScoreDTO();
            List <PlayerStat> returnList = scoreDAO.GetAllScores();

            scoreDTO.ErrorCode = 0;
            scoreDTO.ErrorMsg  = "OK";
            scoreDTO.Scores    = returnList.Count > 0 ? returnList : null;
            return(scoreDTO);
        }