示例#1
0
        public List <SimilarBoardGame> AddOrGetSimilar(string name)
        {
            if (string.IsNullOrWhiteSpace(name))
            {
                return(new List <SimilarBoardGame>());
            }

            var boardGameId = BGGBoardGame.GetBoardGameId(name);

            if (boardGameId != 0)
            {
                var boardGame = BGGBoardGame.GetBoardGameById(boardGameId);
                if (!CheckIfExists(name))
                {
                    Add(boardGame);
                }
                return(new List <SimilarBoardGame>());
            }

            var similarBoardGameList = BGGBoardGame.GetSimilarBoardGameList(name).ToList();

            return(similarBoardGameList.Take(10).ToList());
        }
示例#2
0
 public BoardGame GetBGGBoardGameById(int id)
 {
     return(BGGBoardGame.GetBoardGameById(id));
 }