/// <summary> /// Uses BoardGameGeekXmlApi2Client for some underlying requests that require further information before hitting unofficial API points /// </summary> /// <param name="c"></param> /// <param name="bggClient"></param> public UnofficialBggClient(HttpClient c, BoardGameGeekXmlApi2Client bggClient = null) { _httpClient = c; if (bggClient == null) { bggClient = new BoardGameGeekXmlApi2Client(c); } _bggClient = bggClient; }
private async Task Init() { Mapper = CreateMapper(); RankDb = new RankingDb(); GamesDb = new GamesDb(); VideosDb = new VideosDb(); PlaysDb = new PlaysDb(); _httpClient = new HttpClient(); _bggApiClient = new BoardGameGeekXmlApi2Client(_httpClient); _unofficialBgg = new UnofficialBggClient(_httpClient, _bggApiClient); if (!string.IsNullOrEmpty(await Username())) { var c = new BggCredentials() { Username = await Username(), Password = await Password(), SessionId = await Session() }; _unofficialBgg.Credentials = c; } }