Esempio n. 1
0
        static async Task RunSample1Async(AppConfig appConfig)
        {
            int    accountId   = 999999999;
            string accessToken = "YOUR_OAUTH_TOKEN";

            accountId   = appConfig.AccountId;
            accessToken = appConfig.AccessToken;
            if (string.IsNullOrWhiteSpace(accessToken))
            {
                Console.WriteLine("No access token");
                return;
            }

            var basecampClient = new BasecampClient(accountId, accessToken);
            var projects       = await basecampClient.GetProjectsAsync();

            foreach (var project in projects)
            {
                Console.WriteLine($"Project {project.Name} ({project.Id})");
            }

            if (projects.NextUri != null)
            {
                var moreProjects = await basecampClient.GetMoreProjectsAsync(projects.NextUri);

                foreach (var project in moreProjects)
                {
                    Console.WriteLine($"Project {project.Name} ({project.Id})");
                }
            }
        }