private async void releases_releaseDatesButton_Click(object sender, EventArgs e) { ReleaseDates api = new ReleaseDates { ApiKey = apiKey }; api.Arguments.release_id = 82; if (fredValidationButton.Checked) { api.Arguments.Validators.Clear(); } ReleaseDateContainer container = syncButton.Checked ? api.Fetch() : await api.FetchAsync(); ShowResults(api); }
/// <summary> /// Fetches data from a FRED service endpoint asynchronously. /// </summary> /// <returns> /// A <see cref="ReleaseDateContainer"/> containing FRED data. /// An abnormal fetch returns null and a message is available in the <see cref="FetchMessage"/> property. /// </returns> public async Task <ReleaseDateContainer> FetchAsync() { ReleaseDateContainer result = await base.FetchAsync <ReleaseDateContainer>(); return(result); }
/// <summary> /// Fetches data from a FRED service endpoint. /// </summary> /// <returns> /// A <see cref="ReleaseDateContainer"/> containing FRED data. /// An abnormal fetch returns null and a message is available in the <see cref="FetchMessage"/> property. /// </returns> public ReleaseDateContainer Fetch() { ReleaseDateContainer result = base.Fetch <ReleaseDateContainer>(); return(result); }