private static async Task RunAsync()
        {
            AuthenticationConfig config = AuthenticationConfig.ReadFromJsonFile("appsettings.json");
            var app        = new PublicClientApplication(config.ClientId, config.Authority);
            var httpClient = new HttpClient();

            MyInformation myInformation = new MyInformation(app, httpClient);
            await myInformation.DisplayMeAndMyManagerAsync();
        }
        private static async Task RunAsync()
        {
            SampleConfiguration config = SampleConfiguration.ReadFromJsonFile("appsettings.json");
            var appConfig = config.PublicClientApplicationOptions;
            var app       = PublicClientApplicationBuilder.CreateWithApplicationOptions(appConfig)
                            .Build();
            var httpClient = new HttpClient();

            MyInformation myInformation = new MyInformation(app, httpClient, config.MicrosoftGraphBaseEndpoint);
            await myInformation.DisplayMeAndMyManagerAsync();
        }
예제 #3
0
        static void Main(string[] args)
        {
            MyInformation myInformation = new MyInformation();

            try
            {
                myInformation.DisplayMeAndMyManagerAsync().Wait();
            }
            catch (Exception ex)
            {
                Console.ForegroundColor = ConsoleColor.Red;
                Console.WriteLine(ex.Message);
                Console.ResetColor();
            }
        }