static async Task RunAsync(string[] args) { AuthenticationConfig config = AuthenticationConfig.ReadFromJsonFile("appsettings.json"); var app = new PublicClientApplication(config.ClientId, config.Authority); MyInformation myInformation = new MyInformation(app); await myInformation.DisplayMeAndMyManagerAsync(); var openExtensionsDemo = new OpenExtensionsDemo(app); await openExtensionsDemo.RunAsync(); var schemaExtensionDemo = new SchemaExtensionsDemo(app); await schemaExtensionDemo.RunAsync(); System.Console.WriteLine("Press ENTER to continue."); System.Console.ReadLine(); }
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(); } RunAsync(args).GetAwaiter().GetResult(); }