Ejemplo n.º 1
0
        public async Task <IEnumerable <TiltifyDonation> > GetCampaignDonations(TiltifyCampaign campaign)
        {
            List <TiltifyDonation> results = new List <TiltifyDonation>();

            try
            {
                TiltifyResultArray result = await this.GetAsync <TiltifyResultArray>("campaigns/" + campaign.ID.ToString() + "/donations");

                foreach (JToken token in result.Data)
                {
                    results.Add(token.ToObject <TiltifyDonation>());
                }
            }
            catch (Exception ex) { Logger.Log(ex); }
            return(results);
        }
Ejemplo n.º 2
0
        public async Task <IEnumerable <TiltifyTeam> > GetUserTeams(TiltifyUser user)
        {
            List <TiltifyTeam> results = new List <TiltifyTeam>();

            try
            {
                TiltifyResultArray result = await this.GetAsync <TiltifyResultArray>("users/" + user.ID.ToString() + "/teams");

                foreach (JToken token in result.Data)
                {
                    results.Add(token.ToObject <TiltifyTeam>());
                }
            }
            catch (Exception ex) { Logger.Log(ex); }
            return(results);
        }