using Microsoft.AspNetCore; using OpenIddict.Sandbox.AspNetCore.Client; using OpenIddict.Sandbox.AspNetCore.Client.Models; #if SUPPORTS_WEB_INTEGRATION_IN_GENERIC_HOST var builder = Host.CreateDefaultBuilder(args); builder.ConfigureWebHostDefaults(builder => builder.UseStartup()); #else var builder = WebHost.CreateDefaultBuilder(args); builder.UseStartup(); #endif var app = builder.Build(); // Before starting the host, create the database used to store the application data. // // Note: in a real world application, this step should be part of a setup script. await using (var scope = app.Services.CreateAsyncScope()) { var context = scope.ServiceProvider.GetRequiredService(); await context.Database.EnsureCreatedAsync(); } await app.RunAsync();