public async Task <Contracts.RecentBillsContainer> GetRecentBills(int congress, Chamber chamber, RecentBillType billType, int?offset = null) { string url = apiBaseUrl + String.Format(recentBillsUrl, congress, chamber.ToString().ToLower(), billType.ToString().ToLower()); // we can offset the results to page through them since this endpoint only returns 20 at a time if (offset.HasValue && offset.Value > 0) { url += String.Format(offsetParameter, offset.Value); } var internalModel = await GetMultipleResultDataAsync <InternalModels.RecentBillsContainer>(url); var contract = AutoMapperConfiguration.Mapper.Map < InternalModels.RecentBillsContainer, Contracts.RecentBillsContainer>(internalModel.Results.ElementAt(0)); return(contract); }
public async Task <RecentBillsContainer> GetBills(Chamber chamber, RecentBillType billtype) { var bills = await _propublica.GetRecentBills(116, chamber, billtype); return(bills); }