namespace JiShe.IOT { [DependsOn( typeof(AbpAutofacModule), typeof(AbpTestBaseModule), typeof(AbpAuthorizationModule), typeof(IOTDomainModule) )] public class IOTTestBaseModule : AbpModule { public override void ConfigureServices(ServiceConfigurationContext context) { Configure(options => { options.IsJobExecutionEnabled = false; }); context.Services.AddAlwaysAllowAuthorization(); } public override void OnApplicationInitialization(ApplicationInitializationContext context) { SeedTestData(context); } private static void SeedTestData(ApplicationInitializationContext context) { AsyncHelper.RunSync(async () => { using (var scope = context.ServiceProvider.CreateScope()) { await scope.ServiceProvider .GetRequiredService() .SeedAsync(); } }); } } }