Example #1
0
        private Task <Tuple <List <Bill>, bool, int, string> > GetLegislatorsBillsTask()
        {
            var getBillsTask = new Task <Tuple <List <Bill>, bool, int, string> >((prms) =>
            {
                var passedParams = (prms as Tuple <string, BillManager, int, int>);

                var legislatorId     = passedParams.Item1;
                var bm               = new BillManager(new Logger(Class.SimpleName));
                var localCurrentPage = passedParams.Item3;
                var mode             = (BillViewerKind)((int)passedParams.Item4);

                var results = mode == BillViewerKind.CosponsoredBills
                    ? bm.GetBillsCosponsoredbyLegislator2(legislatorId, localCurrentPage)
                    : bm.GetBillsSponsoredbyLegislator2(legislatorId, localCurrentPage);

                var isThereMoreVotes = results.IsThereMoreResults;

                return(new Tuple <List <Bill>, bool, int, string>(results.Results, isThereMoreVotes, localCurrentPage, string.Empty));
            }, new Tuple <string, BillManager, int, int>(_legislator.IdBioguide, _billManager, currentPage, (int)_viewerMode));

            return(getBillsTask);
        }