using Microsoft.AspNetCore.Authentication; using Microsoft.EntityFrameworkCore; using OpenIddict.Abstractions; using OpenIddict.Demo.Server.EntityFrameworkCore; using Volo.Abp; using Volo.Abp.Account; using Volo.Abp.Account.Web; using Volo.Abp.AspNetCore.Mvc; using Volo.Abp.AspNetCore.Mvc.UI.Theme.Basic; using Volo.Abp.Autofac; using Volo.Abp.Data; using Volo.Abp.EntityFrameworkCore; using Volo.Abp.EntityFrameworkCore.SqlServer; using Volo.Abp.FeatureManagement; using Volo.Abp.FeatureManagement.EntityFrameworkCore; using Volo.Abp.Identity; using Volo.Abp.Identity.EntityFrameworkCore; using Volo.Abp.Identity.Web; using Volo.Abp.Modularity; using Volo.Abp.OpenIddict; using Volo.Abp.OpenIddict.EntityFrameworkCore; using Volo.Abp.PermissionManagement; using Volo.Abp.PermissionManagement.EntityFrameworkCore; using Volo.Abp.PermissionManagement.HttpApi; using Volo.Abp.PermissionManagement.Identity; using Volo.Abp.SettingManagement; using Volo.Abp.SettingManagement.EntityFrameworkCore; using Volo.Abp.SettingManagement.Web; namespace OpenIddict.Demo.Server; [DependsOn( typeof(AbpAspNetCoreMvcModule), typeof(AbpAutofacModule), typeof(AbpEntityFrameworkCoreSqlServerModule), typeof(AbpAspNetCoreMvcUiBasicThemeModule), typeof(AbpOpenIddictAspNetCoreModule), typeof(AbpOpenIddictEntityFrameworkCoreModule), typeof(AbpAccountApplicationModule), typeof(AbpAccountHttpApiModule), typeof(AbpAccountWebModule), typeof(AbpPermissionManagementDomainIdentityModule), typeof(AbpIdentityApplicationModule), typeof(AbpIdentityHttpApiModule), typeof(AbpIdentityEntityFrameworkCoreModule), typeof(AbpIdentityWebModule), typeof(AbpPermissionManagementApplicationModule), typeof(AbpPermissionManagementHttpApiModule), typeof(AbpPermissionManagementEntityFrameworkCoreModule), typeof(AbpFeatureManagementApplicationModule), typeof(AbpFeatureManagementEntityFrameworkCoreModule), typeof(AbpFeatureManagementHttpApiModule), typeof(AbpFeatureManagementWebModule), typeof(AbpSettingManagementApplicationModule), typeof(AbpSettingManagementEntityFrameworkCoreModule), typeof(AbpSettingManagementHttpApiModule), typeof(AbpSettingManagementWebModule) )] public class OpenIddictServerModule : AbpModule { public override void ConfigureServices(ServiceConfigurationContext context) { context.Services.AddAbpDbContext(options => { options.AddDefaultRepositories(includeAllEntities: true); }); Configure(options => { options.UseSqlServer(); }); } public async override Task OnApplicationInitializationAsync(ApplicationInitializationContext context) { var dbContext = context.ServiceProvider .GetRequiredService(); if ((await dbContext.Database.GetPendingMigrationsAsync()).Any()) { await dbContext.Database.MigrateAsync(); } await context.ServiceProvider .GetRequiredService() .SeedAsync(); } }