Пример #1
0
        public async Task <IEnumerable <int> > BoardGameIds(string boardGameName)
        {
            Debug.WriteLine("Search for " + boardGameName);
            BGGParser parser = new BGGParser();

            return(await parser.GetBoardGameIds(boardGameName));
        }
Пример #2
0
        private async Task AddBoardGamesToCache(IEnumerable <int> ids)
        {
            var       count  = ids.Count();
            BGGParser parser = new BGGParser();
            var       bgs    = await parser.GetBoardGames(ids);

            lock (syncRoot)
            {
                foreach (BoardGame bg in bgs)
                {
                    if (!IsCached(bg))
                    {
                        Cache.Add(bg.ObjectId, bg);
                    }
                }
            }
        }