/// <summary> /// Clear the cache for this repository. /// </summary> public void ClearCache() { this.m_venueStocks = null; }
/// <summary> /// Investigates whether a specific venue is operating as intended. /// </summary> /// <param name="venue">Code of the venue to interrogate.</param> /// <returns>Model indicating either that the venue is up, or the failure message returned.</returns> public async Task<VenueStocksModel> GetStocks() { if (this.m_venueStocks == null) { // A lock is not necessary here for thread safety; worst-case, // it gets set twice. using (var client = this.GetHttpClient()) { var response = await client.GetAsync(String.Format("venues/{0}/stocks", this.m_venue)).ConfigureAwait(false); this.m_venueStocks = await StockExchangeUtility.GetResponseOrErrorModel<VenueStocksModel>(response).ConfigureAwait(false); } } return this.m_venueStocks; }