diff --git a/docs/AspNetCore/Bundling-Minification.md b/docs/AspNetCore/Bundling-Minification.md index cf9f873216..561211e6a7 100644 --- a/docs/AspNetCore/Bundling-Minification.md +++ b/docs/AspNetCore/Bundling-Minification.md @@ -111,9 +111,9 @@ Example usage: [DependsOn(typeof(AbpAspNetCoreMvcUiBundlingModule))] public class MyWebModule : AbpModule { - public override void ConfigureServices(IServiceCollection services) + public override void ConfigureServices(ServiceConfigurationContext context) { - services.Configure(options => + context.Services.Configure(options => { options .ScriptBundles @@ -148,9 +148,9 @@ ABP supports [modularity](../Module-Development-Basics.md) for bundling too. A m [DependsOn(typeof(MyWebModule))] public class MyWebExtensionModule : AbpModule { - public override void ConfigureServices(IServiceCollection services) + public override void ConfigureServices(ServiceConfigurationContext context) { - services.Configure(options => + context.Services.Configure(options => { options .ScriptBundles diff --git a/docs/Best-Practices/Entity-Framework-Core-Integration.md b/docs/Best-Practices/Entity-Framework-Core-Integration.md index a825a31852..0dd6bb63fc 100644 --- a/docs/Best-Practices/Entity-Framework-Core-Integration.md +++ b/docs/Best-Practices/Entity-Framework-Core-Integration.md @@ -196,15 +196,15 @@ protected override IQueryable IncludeDetails(IQueryable(options => + context.Services.AddAbpDbContext(options => { options.AddRepository(); options.AddRepository(); }); - services.AddAssemblyOf(); + context.Services.AddAssemblyOf(); } } ```` diff --git a/docs/Best-Practices/MongoDB-Integration.md b/docs/Best-Practices/MongoDB-Integration.md index a23e1a903a..25b8c9aee3 100644 --- a/docs/Best-Practices/MongoDB-Integration.md +++ b/docs/Best-Practices/MongoDB-Integration.md @@ -185,17 +185,17 @@ public async Task FindByNormalizedUserNameAsync( )] public class AbpIdentityMongoDbModule : AbpModule { - public override void ConfigureServices(IServiceCollection services) + public override void ConfigureServices(ServiceConfigurationContext context) { AbpIdentityBsonClassMap.Configure(); - services.AddMongoDbContext(options => + context.Services.AddMongoDbContext(options => { options.AddRepository(); options.AddRepository(); }); - services.AddAssemblyOf(); + context.Services.AddAssemblyOf(); } } ``` diff --git a/docs/Dependency-Injection.md b/docs/Dependency-Injection.md index 0e3a840d51..d9781926d0 100644 --- a/docs/Dependency-Injection.md +++ b/docs/Dependency-Injection.md @@ -9,7 +9,7 @@ Since ABP is a modular framework, every module defines it's services and registe ````C# public class BlogModule : AbpModule { - public override void ConfigureServices(IServiceCollection services) + public override void ConfigureServices(ServiceConfigurationContext context) { //register dependencies here } @@ -23,9 +23,9 @@ ABP introduces conventional service registration. To register all services of a ````C# public class BlogModule : AbpModule { - public override void ConfigureServices(IServiceCollection services) + public override void ConfigureServices(ServiceConfigurationContext context) { - services.AddAssemblyOf(); + context.Services.AddAssemblyOf(); } } ```` @@ -134,16 +134,16 @@ In some cases, you may need to register a service to IServiceCollection manually ````C# public class BlogModule : AbpModule { - public override void ConfigureServices(IServiceCollection services) + public override void ConfigureServices(ServiceConfigurationContext context) { //Add services by convention - services.AddAssemblyOf(); + context.Services.AddAssemblyOf(); //Register an instance as singleton - services.AddSingleton(new TaxCalculator(taxRatio: 0.18)); + context.Services.AddSingleton(new TaxCalculator(taxRatio: 0.18)); //Register a factory method that resolves from IServiceProvider - services.AddScoped(sp => sp.GetRequiredService()); + context.Services.AddScoped(sp => sp.GetRequiredService()); } } ```` @@ -153,16 +153,16 @@ Finally, you may want to add a single class or a few classes by ABP's convention ````C# public class BlogModule : AbpModule { - public override void ConfigureServices(IServiceCollection services) + public override void ConfigureServices(ServiceConfigurationContext context) { //Add single type - services.AddType(typeof(TaxCalculator)); + context.Services.AddType(typeof(TaxCalculator)); //Add multiple types in once call - services.AddTypes(typeof(TaxCalculator), typeof(MyOtherService)); + context.Services.AddTypes(typeof(TaxCalculator), typeof(MyOtherService)); //Add single type using generic shortcut - services.AddType(); + context.Services.AddType(); } } ```` diff --git a/docs/Entity-Framework-Core.md b/docs/Entity-Framework-Core.md index a03f5b0be0..1d1a5d5f9d 100644 --- a/docs/Entity-Framework-Core.md +++ b/docs/Entity-Framework-Core.md @@ -62,9 +62,9 @@ namespace MyCompany.MyProject [DependsOn(typeof(AbpEntityFrameworkCoreModule))] public class MyModule : AbpModule { - public override void ConfigureServices(IServiceCollection services) + public override void ConfigureServices(ServiceConfigurationContext context) { - services.AddAbpDbContext(); + context.Services.AddAbpDbContext(); //... } diff --git a/docs/Getting-Started-AspNetCore-Application.md b/docs/Getting-Started-AspNetCore-Application.md index 9e45d80e5d..30d956c53c 100644 --- a/docs/Getting-Started-AspNetCore-Application.md +++ b/docs/Getting-Started-AspNetCore-Application.md @@ -40,9 +40,9 @@ namespace BasicAspNetCoreApplication [DependsOn(typeof(AbpAspNetCoreMvcModule))] public class AppModule : AbpModule { - public override void ConfigureServices(IServiceCollection services) + public override void ConfigureServices(ServiceConfigurationContext context) { - services.AddAssemblyOf(); + context.Services.AddAssemblyOf(); } public override void OnApplicationInitialization(ApplicationInitializationContext context) @@ -82,11 +82,11 @@ namespace BasicAspNetCoreApplication { public class Startup { - public IServiceProvider ConfigureServices(IServiceCollection services) + public IServiceProvider ConfigureServices(ServiceConfigurationContext context) { - services.AddApplication(); + context.Services.AddApplication(); - return services.BuildServiceProviderFromFactory(); + return context.Services.BuildServiceProviderFromFactory(); } public void Configure(IApplicationBuilder app) diff --git a/docs/Getting-Started-Console-Application.md b/docs/Getting-Started-Console-Application.md index 9f176be5c9..2fdebd4356 100644 --- a/docs/Getting-Started-Console-Application.md +++ b/docs/Getting-Started-Console-Application.md @@ -28,9 +28,9 @@ namespace AbpConsoleDemo { public class AppModule : AbpModule { - public override void ConfigureServices(IServiceCollection services) + public override void ConfigureServices(ServiceConfigurationContext context) { - services.AddAssemblyOf(); + context.Services.AddAssemblyOf(); } } } diff --git a/docs/Localization.md b/docs/Localization.md index 5d1a856cac..ba7bf04238 100644 --- a/docs/Localization.md +++ b/docs/Localization.md @@ -44,14 +44,14 @@ Then it should be added using `AbpLocalizationOptions` as shown below: [DependsOn(typeof(AbpLocalizationModule))] public class MyModule : AbpModule { - public override void ConfigureServices(IServiceCollection services) + public override void ConfigureServices(ServiceConfigurationContext context) { - services.Configure(options => + context.Services.Configure(options => { options.FileSets.AddEmbedded(); }); - services.Configure(options => + context.Services.Configure(options => { options.Resources .Add("en") diff --git a/docs/Module-Development-Basics.md b/docs/Module-Development-Basics.md index dabc036eaa..151bd9987a 100644 --- a/docs/Module-Development-Basics.md +++ b/docs/Module-Development-Basics.md @@ -25,7 +25,7 @@ public class BlogModule : AbpModule ````C# public class BlogModule : AbpModule { - public override void ConfigureServices(IServiceCollection services) + public override void ConfigureServices(ServiceConfigurationContext context) { //... } @@ -37,9 +37,9 @@ You can register dependencies one by one as stated in Microsoft's (); + context.Services.AddMongoDbContext(); //... } diff --git a/docs/Multi-Tenancy.md b/docs/Multi-Tenancy.md index ee807a3821..6697e10124 100644 --- a/docs/Multi-Tenancy.md +++ b/docs/Multi-Tenancy.md @@ -136,9 +136,9 @@ namespace MyCompany.MyProject [DependsOn(typeof(AbpMultiTenancyModule))] public class MyModule : AbpModule { - public override void ConfigureServices(IServiceCollection services) + public override void ConfigureServices(ServiceConfigurationContext context) { - services.Configure(options => + context.Services.Configure(options => { options.TenantResolvers.Add(new MyCustomTenantResolver()); }); @@ -192,9 +192,9 @@ namespace MyCompany.MyProject [DependsOn(typeof(AbpMultiTenancyModule))] public class MyModule : AbpModule { - public override void ConfigureServices(IServiceCollection services) + public override void ConfigureServices(ServiceConfigurationContext context) { - services.Configure(options => + context.Services.Configure(options => { options.Tenants = new[] { @@ -236,11 +236,11 @@ namespace MyCompany.MyProject [DependsOn(typeof(AbpMultiTenancyModule))] public class MyModule : AbpModule { - public override void ConfigureServices(IServiceCollection services) + public override void ConfigureServices(ServiceConfigurationContext context) { var configuration = BuildConfiguration(); - services.Configure(configuration); + context.Services.Configure(configuration); } private static IConfigurationRoot BuildConfiguration() @@ -359,9 +359,9 @@ namespace MyCompany.MyProject [DependsOn(typeof(AbpAspNetCoreMultiTenancyModule))] public class MyModule : AbpModule { - public override void ConfigureServices(IServiceCollection services) + public override void ConfigureServices(ServiceConfigurationContext context) { - services.Configure(options => + context.Services.Configure(options => { //Subdomain format: {0}.mydomain.com (adding as the highest priority resolver) options.TenantResolvers.Insert(0, new DomainTenantResolver("{0}.mydomain.com")); diff --git a/docs/Virtual-File-System.md b/docs/Virtual-File-System.md index bd805669e9..78725c290d 100644 --- a/docs/Virtual-File-System.md +++ b/docs/Virtual-File-System.md @@ -56,9 +56,9 @@ namespace MyCompany.MyProject [DependsOn(typeof(AbpVirtualFileSystemModule))] public class MyModule : AbpModule { - public override void ConfigureServices(IServiceCollection services) + public override void ConfigureServices(ServiceConfigurationContext context) { - services.Configure(options => + context.Services.Configure(options => { //Register all embedded files of this assembly to the virtual file system options.FileSets.AddEmbedded(); @@ -116,13 +116,13 @@ The example below shows an application depends on a module (`MyModule`) that con [DependsOn(typeof(MyModule))] public class MyWebAppModule : AbpModule { - public override void ConfigureServices(IServiceCollection services) + public override void ConfigureServices(ServiceConfigurationContext context) { - var hostingEnvironment = services.GetHostingEnvironment(); + var hostingEnvironment = context.Services.GetHostingEnvironment(); if (hostingEnvironment.IsDevelopment()) //only for development time { - services.Configure(options => + context.Services.Configure(options => { //ReplaceEmbeddedByPyhsical gets the root folder of the MyModule project options.FileSets.ReplaceEmbeddedByPyhsical( diff --git a/framework/src/Volo.Abp.ApiVersioning.Abstractions/Volo/Abp/ApiVersioning/AbpApiVersioningAbstractionsModule.cs b/framework/src/Volo.Abp.ApiVersioning.Abstractions/Volo/Abp/ApiVersioning/AbpApiVersioningAbstractionsModule.cs index 3e5a7adf17..b4f679c927 100644 --- a/framework/src/Volo.Abp.ApiVersioning.Abstractions/Volo/Abp/ApiVersioning/AbpApiVersioningAbstractionsModule.cs +++ b/framework/src/Volo.Abp.ApiVersioning.Abstractions/Volo/Abp/ApiVersioning/AbpApiVersioningAbstractionsModule.cs @@ -5,9 +5,9 @@ namespace Volo.Abp.ApiVersioning { public class AbpApiVersioningAbstractionsModule : AbpModule { - public override void ConfigureServices(IServiceCollection services) + public override void ConfigureServices(ServiceConfigurationContext context) { - services.AddSingleton(NullRequestedApiVersion.Instance); + context.Services.AddSingleton(NullRequestedApiVersion.Instance); } } } diff --git a/framework/src/Volo.Abp.AspNetCore.Authentication.OAuth/Volo/Abp/AspNetCore/Authentication/OAuth/AbpAspNetCoreAuthenticationOAuthModule.cs b/framework/src/Volo.Abp.AspNetCore.Authentication.OAuth/Volo/Abp/AspNetCore/Authentication/OAuth/AbpAspNetCoreAuthenticationOAuthModule.cs index 35c75ed11c..03caf3b86e 100644 --- a/framework/src/Volo.Abp.AspNetCore.Authentication.OAuth/Volo/Abp/AspNetCore/Authentication/OAuth/AbpAspNetCoreAuthenticationOAuthModule.cs +++ b/framework/src/Volo.Abp.AspNetCore.Authentication.OAuth/Volo/Abp/AspNetCore/Authentication/OAuth/AbpAspNetCoreAuthenticationOAuthModule.cs @@ -7,9 +7,9 @@ namespace Volo.Abp.AspNetCore.Authentication.OAuth [DependsOn(typeof(AbpSecurityModule))] public class AbpAspNetCoreAuthenticationOAuthModule : AbpModule { - public override void ConfigureServices(IServiceCollection services) + public override void ConfigureServices(ServiceConfigurationContext context) { - services.AddAssemblyOf(); + context.Services.AddAssemblyOf(); } } } diff --git a/framework/src/Volo.Abp.AspNetCore.MultiTenancy/Volo/Abp/AspNetCore/MultiTenancy/AbpAspNetCoreMultiTenancyModule.cs b/framework/src/Volo.Abp.AspNetCore.MultiTenancy/Volo/Abp/AspNetCore/MultiTenancy/AbpAspNetCoreMultiTenancyModule.cs index a5a10f6528..99dec58953 100644 --- a/framework/src/Volo.Abp.AspNetCore.MultiTenancy/Volo/Abp/AspNetCore/MultiTenancy/AbpAspNetCoreMultiTenancyModule.cs +++ b/framework/src/Volo.Abp.AspNetCore.MultiTenancy/Volo/Abp/AspNetCore/MultiTenancy/AbpAspNetCoreMultiTenancyModule.cs @@ -10,9 +10,9 @@ namespace Volo.Abp.AspNetCore.MultiTenancy )] public class AbpAspNetCoreMultiTenancyModule : AbpModule { - public override void ConfigureServices(IServiceCollection services) + public override void ConfigureServices(ServiceConfigurationContext context) { - services.Configure(options => + context.Services.Configure(options => { options.TenantResolvers.Add(new QueryStringTenantResolveContributer()); options.TenantResolvers.Add(new RouteTenantResolveContributer()); @@ -20,7 +20,7 @@ namespace Volo.Abp.AspNetCore.MultiTenancy options.TenantResolvers.Add(new CookieTenantResolveContributer()); }); - services.AddAssemblyOf(); + context.Services.AddAssemblyOf(); } } } diff --git a/framework/src/Volo.Abp.AspNetCore.Mvc.UI.Bootstrap/AbpAspNetCoreMvcUiBootstrapModule.cs b/framework/src/Volo.Abp.AspNetCore.Mvc.UI.Bootstrap/AbpAspNetCoreMvcUiBootstrapModule.cs index cad8c6062f..213a22296f 100644 --- a/framework/src/Volo.Abp.AspNetCore.Mvc.UI.Bootstrap/AbpAspNetCoreMvcUiBootstrapModule.cs +++ b/framework/src/Volo.Abp.AspNetCore.Mvc.UI.Bootstrap/AbpAspNetCoreMvcUiBootstrapModule.cs @@ -7,11 +7,11 @@ namespace Volo.Abp.AspNetCore.Mvc.UI.Bootstrap [DependsOn(typeof(AbpAspNetCoreMvcUiModule))] public class AbpAspNetCoreMvcUiBootstrapModule : AbpModule { - public override void ConfigureServices(IServiceCollection services) + public override void ConfigureServices(ServiceConfigurationContext context) { - services.AddAssemblyOf(); + context.Services.AddAssemblyOf(); - services.Configure(options => + context.Services.Configure(options => { options.FileSets.AddEmbedded("Volo.Abp.AspNetCore.Mvc.UI.Bootstrap"); }); diff --git a/framework/src/Volo.Abp.AspNetCore.Mvc.UI.Bundling/Volo/Abp/AspNetCore/Mvc/UI/Bundling/AbpAspNetCoreMvcUiBundlingModule.cs b/framework/src/Volo.Abp.AspNetCore.Mvc.UI.Bundling/Volo/Abp/AspNetCore/Mvc/UI/Bundling/AbpAspNetCoreMvcUiBundlingModule.cs index 0f305efe33..920f70534d 100644 --- a/framework/src/Volo.Abp.AspNetCore.Mvc.UI.Bundling/Volo/Abp/AspNetCore/Mvc/UI/Bundling/AbpAspNetCoreMvcUiBundlingModule.cs +++ b/framework/src/Volo.Abp.AspNetCore.Mvc.UI.Bundling/Volo/Abp/AspNetCore/Mvc/UI/Bundling/AbpAspNetCoreMvcUiBundlingModule.cs @@ -7,9 +7,9 @@ namespace Volo.Abp.AspNetCore.Mvc.UI.Bundling [DependsOn(typeof(AbpAspNetCoreMvcUiBootstrapModule))] public class AbpAspNetCoreMvcUiBundlingModule : AbpModule { - public override void ConfigureServices(IServiceCollection services) + public override void ConfigureServices(ServiceConfigurationContext context) { - services.AddAssemblyOf(); + context.Services.AddAssemblyOf(); } } } diff --git a/framework/src/Volo.Abp.AspNetCore.Mvc.UI.Packages/Volo/Abp/AspNetCore/Mvc/UI/Packages/AbpAspNetCoreMvcUiPackagesModule.cs b/framework/src/Volo.Abp.AspNetCore.Mvc.UI.Packages/Volo/Abp/AspNetCore/Mvc/UI/Packages/AbpAspNetCoreMvcUiPackagesModule.cs index dc9a7c13ed..ea58b8c457 100644 --- a/framework/src/Volo.Abp.AspNetCore.Mvc.UI.Packages/Volo/Abp/AspNetCore/Mvc/UI/Packages/AbpAspNetCoreMvcUiPackagesModule.cs +++ b/framework/src/Volo.Abp.AspNetCore.Mvc.UI.Packages/Volo/Abp/AspNetCore/Mvc/UI/Packages/AbpAspNetCoreMvcUiPackagesModule.cs @@ -7,9 +7,9 @@ namespace Volo.Abp.AspNetCore.Mvc.UI.Packages [DependsOn(typeof(AbpAspNetCoreMvcUiBundlingModule))] public class AbpAspNetCoreMvcUiPackagesModule : AbpModule { - public override void ConfigureServices(IServiceCollection services) + public override void ConfigureServices(ServiceConfigurationContext context) { - services.AddAssemblyOf(); + context.Services.AddAssemblyOf(); } } } diff --git a/framework/src/Volo.Abp.AspNetCore.Mvc.UI.Theme.Basic/AbpAspNetCoreMvcUIBasicThemeModule.cs b/framework/src/Volo.Abp.AspNetCore.Mvc.UI.Theme.Basic/AbpAspNetCoreMvcUIBasicThemeModule.cs index d4fd3cadd7..0801850971 100644 --- a/framework/src/Volo.Abp.AspNetCore.Mvc.UI.Theme.Basic/AbpAspNetCoreMvcUIBasicThemeModule.cs +++ b/framework/src/Volo.Abp.AspNetCore.Mvc.UI.Theme.Basic/AbpAspNetCoreMvcUIBasicThemeModule.cs @@ -16,9 +16,9 @@ namespace Volo.Abp.AspNetCore.Mvc.UI.Theme.Basic )] public class AbpAspNetCoreMvcUiBasicThemeModule : AbpModule { - public override void ConfigureServices(IServiceCollection services) + public override void ConfigureServices(ServiceConfigurationContext context) { - services.Configure(options => + context.Services.Configure(options => { options.Themes.Add(); @@ -28,17 +28,17 @@ namespace Volo.Abp.AspNetCore.Mvc.UI.Theme.Basic } }); - services.Configure(options => + context.Services.Configure(options => { options.FileSets.AddEmbedded("Volo.Abp.AspNetCore.Mvc.UI.Theme.Basic"); }); - services.Configure(options => + context.Services.Configure(options => { options.Contributors.Add(new BasicThemeMainTopToolbarContributor()); }); - services.Configure(options => + context.Services.Configure(options => { options .StyleBundles @@ -57,7 +57,7 @@ namespace Volo.Abp.AspNetCore.Mvc.UI.Theme.Basic }); }); - services.AddAssemblyOf(); + context.Services.AddAssemblyOf(); } } } diff --git a/framework/src/Volo.Abp.AspNetCore.Mvc.UI.Theme.Shared/AbpAspNetCoreMvcUiThemeSharedModule.cs b/framework/src/Volo.Abp.AspNetCore.Mvc.UI.Theme.Shared/AbpAspNetCoreMvcUiThemeSharedModule.cs index a929a0c358..efd99d93ff 100644 --- a/framework/src/Volo.Abp.AspNetCore.Mvc.UI.Theme.Shared/AbpAspNetCoreMvcUiThemeSharedModule.cs +++ b/framework/src/Volo.Abp.AspNetCore.Mvc.UI.Theme.Shared/AbpAspNetCoreMvcUiThemeSharedModule.cs @@ -14,14 +14,14 @@ namespace Volo.Abp.AspNetCore.Mvc.UI.Theme.Shared )] public class AbpAspNetCoreMvcUiThemeSharedModule : AbpModule { - public override void ConfigureServices(IServiceCollection services) + public override void ConfigureServices(ServiceConfigurationContext context) { - services.Configure(options => + context.Services.Configure(options => { options.FileSets.AddEmbedded("Volo.Abp.AspNetCore.Mvc.UI.Theme.Shared"); }); - services.Configure(options => + context.Services.Configure(options => { options .StyleBundles @@ -32,7 +32,7 @@ namespace Volo.Abp.AspNetCore.Mvc.UI.Theme.Shared .Add(StandardBundles.Scripts.Global, bundle => bundle.AddContributors(typeof(SharedThemeGlobalScriptContributor))); }); - services.AddAssemblyOf(); + context.Services.AddAssemblyOf(); } } } diff --git a/framework/src/Volo.Abp.AspNetCore.Mvc.UI/Volo/Abp/AspNetCore/Mvc/UI/AbpAspNetCoreMvcUiModule.cs b/framework/src/Volo.Abp.AspNetCore.Mvc.UI/Volo/Abp/AspNetCore/Mvc/UI/AbpAspNetCoreMvcUiModule.cs index 7dc8c53bc8..5ea2b7ddb7 100644 --- a/framework/src/Volo.Abp.AspNetCore.Mvc.UI/Volo/Abp/AspNetCore/Mvc/UI/AbpAspNetCoreMvcUiModule.cs +++ b/framework/src/Volo.Abp.AspNetCore.Mvc.UI/Volo/Abp/AspNetCore/Mvc/UI/AbpAspNetCoreMvcUiModule.cs @@ -8,9 +8,9 @@ namespace Volo.Abp.AspNetCore.Mvc.UI [DependsOn(typeof(AbpUiNavigationModule))] public class AbpAspNetCoreMvcUiModule : AbpModule { - public override void ConfigureServices(IServiceCollection services) + public override void ConfigureServices(ServiceConfigurationContext context) { - services.AddAssemblyOf(); + context.Services.AddAssemblyOf(); } } } diff --git a/framework/src/Volo.Abp.AspNetCore.Mvc/Volo/Abp/AspNetCore/Mvc/AbpAspNetCoreMvcModule.cs b/framework/src/Volo.Abp.AspNetCore.Mvc/Volo/Abp/AspNetCore/Mvc/AbpAspNetCoreMvcModule.cs index 7347d8e505..50b2d621c9 100644 --- a/framework/src/Volo.Abp.AspNetCore.Mvc/Volo/Abp/AspNetCore/Mvc/AbpAspNetCoreMvcModule.cs +++ b/framework/src/Volo.Abp.AspNetCore.Mvc/Volo/Abp/AspNetCore/Mvc/AbpAspNetCoreMvcModule.cs @@ -35,21 +35,21 @@ namespace Volo.Abp.AspNetCore.Mvc [DependsOn(typeof(AbpUiModule))] public class AbpAspNetCoreMvcModule : AbpModule { - public override void PreConfigureServices(IServiceCollection services) + public override void PreConfigureServices(ServiceConfigurationContext context) { - services.AddConventionalRegistrar(new AbpAspNetCoreMvcConventionalRegistrar()); + context.Services.AddConventionalRegistrar(new AbpAspNetCoreMvcConventionalRegistrar()); } - public override void ConfigureServices(IServiceCollection services) + public override void ConfigureServices(ServiceConfigurationContext context) { //Configure Razor - services.Insert(0, + context.Services.Insert(0, ServiceDescriptor.Singleton>( new ConfigureOptions(options => { options.FileProviders.Add( new AspNetCoreVirtualFileProvider( - services.GetSingletonInstance>() + context.Services.GetSingletonInstance>() ) ); } @@ -57,14 +57,14 @@ namespace Volo.Abp.AspNetCore.Mvc ) ); - services.Configure(options => + context.Services.Configure(options => { options.IgnoredInterfaces.AddIfNotContains(typeof(IAsyncActionFilter)); options.IgnoredInterfaces.AddIfNotContains(typeof(IFilterMetadata)); options.IgnoredInterfaces.AddIfNotContains(typeof(IActionFilter)); }); - services.Configure(options => + context.Services.Configure(options => { options.ConventionalControllers.Create(typeof(AbpAspNetCoreMvcModule).Assembly, o => { @@ -72,13 +72,13 @@ namespace Volo.Abp.AspNetCore.Mvc }); }); - var mvcCoreBuilder = services.AddMvcCore(); - services.ExecutePreConfiguredActions(mvcCoreBuilder); + var mvcCoreBuilder = context.Services.AddMvcCore(); + context.Services.ExecutePreConfiguredActions(mvcCoreBuilder); - var mvcBuilder = services.AddMvc() + var mvcBuilder = context.Services.AddMvc() .AddDataAnnotationsLocalization(options => { - var assemblyResources = services.ExecutePreConfiguredActions(new AbpMvcDataAnnotationsLocalizationOptions()).AssemblyResources; + var assemblyResources = context.Services.ExecutePreConfiguredActions(new AbpMvcDataAnnotationsLocalizationOptions()).AssemblyResources; options.DataAnnotationLocalizerProvider = (type, factory) => { @@ -88,30 +88,30 @@ namespace Volo.Abp.AspNetCore.Mvc }) .AddViewLocalization(); //TODO: How to configure from the application? Also, consider to move to a UI module since APIs does not care about it. - services.ExecutePreConfiguredActions(mvcBuilder); + context.Services.ExecutePreConfiguredActions(mvcBuilder); //TODO: AddViewLocalization by default..? - services.TryAddSingleton(); + context.Services.TryAddSingleton(); //Use DI to create controllers - services.Replace(ServiceDescriptor.Transient()); + context.Services.Replace(ServiceDescriptor.Transient()); //Use DI to create view components - services.Replace(ServiceDescriptor.Singleton()); + context.Services.Replace(ServiceDescriptor.Singleton()); //Add feature providers - var partManager = services.GetSingletonInstance(); - var application = services.GetSingletonInstance(); + var partManager = context.Services.GetSingletonInstance(); + var application = context.Services.GetSingletonInstance(); partManager.FeatureProviders.Add(new AbpConventionalControllerFeatureProvider(application)); - services.Configure(mvcOptions => + context.Services.Configure(mvcOptions => { - mvcOptions.AddAbp(services); + mvcOptions.AddAbp(context.Services); }); - services.AddAssemblyOf(); + context.Services.AddAssemblyOf(); } public override void OnApplicationInitialization(ApplicationInitializationContext context) diff --git a/framework/src/Volo.Abp.AspNetCore.TestBase/Volo/Abp/AspNetCore/TestBase/AbpAspNetCoreTestBaseModule.cs b/framework/src/Volo.Abp.AspNetCore.TestBase/Volo/Abp/AspNetCore/TestBase/AbpAspNetCoreTestBaseModule.cs index c6828feea5..3f9fd65b0a 100644 --- a/framework/src/Volo.Abp.AspNetCore.TestBase/Volo/Abp/AspNetCore/TestBase/AbpAspNetCoreTestBaseModule.cs +++ b/framework/src/Volo.Abp.AspNetCore.TestBase/Volo/Abp/AspNetCore/TestBase/AbpAspNetCoreTestBaseModule.cs @@ -8,9 +8,9 @@ namespace Volo.Abp.AspNetCore.TestBase [DependsOn(typeof(AbpAspNetCoreModule))] public class AbpAspNetCoreTestBaseModule : AbpModule { - public override void ConfigureServices(IServiceCollection services) + public override void ConfigureServices(ServiceConfigurationContext context) { - services.AddAssemblyOf(); + context.Services.AddAssemblyOf(); } } } \ No newline at end of file diff --git a/framework/src/Volo.Abp.AspNetCore/Volo/Abp/AspNetCore/AbpAspNetCoreModule.cs b/framework/src/Volo.Abp.AspNetCore/Volo/Abp/AspNetCore/AbpAspNetCoreModule.cs index db80de9e79..724e7243c5 100644 --- a/framework/src/Volo.Abp.AspNetCore/Volo/Abp/AspNetCore/AbpAspNetCoreModule.cs +++ b/framework/src/Volo.Abp.AspNetCore/Volo/Abp/AspNetCore/AbpAspNetCoreModule.cs @@ -12,15 +12,15 @@ namespace Volo.Abp.AspNetCore [DependsOn(typeof(AbpVirtualFileSystemModule))] public class AbpAspNetCoreModule : IAbpModule { - public void ConfigureServices(IServiceCollection services) + public void ConfigureServices(ServiceConfigurationContext context) { - AddAspNetServices(services); + AddAspNetServices(context.Services); - services.AddObjectAccessor(); + context.Services.AddObjectAccessor(); - services.AddConfiguration(); + context.Services.AddConfiguration(); - services.AddAssemblyOf(); + context.Services.AddAssemblyOf(); } private static void AddAspNetServices(IServiceCollection services) diff --git a/framework/src/Volo.Abp.Auditing/Volo/Abp/Auditing/AbpAuditingModule.cs b/framework/src/Volo.Abp.Auditing/Volo/Abp/Auditing/AbpAuditingModule.cs index 99b9cafe49..8be1b456df 100644 --- a/framework/src/Volo.Abp.Auditing/Volo/Abp/Auditing/AbpAuditingModule.cs +++ b/framework/src/Volo.Abp.Auditing/Volo/Abp/Auditing/AbpAuditingModule.cs @@ -16,9 +16,9 @@ namespace Volo.Abp.Auditing )] public class AbpAuditingModule : AbpModule { - public override void ConfigureServices(IServiceCollection services) + public override void ConfigureServices(ServiceConfigurationContext context) { - services.AddAssemblyOf(); + context.Services.AddAssemblyOf(); } } } diff --git a/framework/src/Volo.Abp.Authorization/Volo/Abp/Authorization/AbpAuthorizationModule.cs b/framework/src/Volo.Abp.Authorization/Volo/Abp/Authorization/AbpAuthorizationModule.cs index bb4c941da7..5d98925336 100644 --- a/framework/src/Volo.Abp.Authorization/Volo/Abp/Authorization/AbpAuthorizationModule.cs +++ b/framework/src/Volo.Abp.Authorization/Volo/Abp/Authorization/AbpAuthorizationModule.cs @@ -13,24 +13,24 @@ namespace Volo.Abp.Authorization )] public class AbpAuthorizationModule : AbpModule { - public override void PreConfigureServices(IServiceCollection services) + public override void PreConfigureServices(ServiceConfigurationContext context) { - services.OnRegistred(AuthorizationInterceptorRegistrar.RegisterIfNeeded); + context.Services.OnRegistred(AuthorizationInterceptorRegistrar.RegisterIfNeeded); } - public override void ConfigureServices(IServiceCollection services) + public override void ConfigureServices(ServiceConfigurationContext context) { - services.AddAuthorization(); + context.Services.AddAuthorization(); - services.AddSingleton(); + context.Services.AddSingleton(); - services.Configure(options => + context.Services.Configure(options => { options.ValueProviders.Add(); options.ValueProviders.Add(); }); - services.AddAssemblyOf(); + context.Services.AddAssemblyOf(); } } } diff --git a/framework/src/Volo.Abp.AutoMapper/Volo/Abp/AutoMapper/AbpAutoMapperModule.cs b/framework/src/Volo.Abp.AutoMapper/Volo/Abp/AutoMapper/AbpAutoMapperModule.cs index ee2d5cb9e8..e92717ead2 100644 --- a/framework/src/Volo.Abp.AutoMapper/Volo/Abp/AutoMapper/AbpAutoMapperModule.cs +++ b/framework/src/Volo.Abp.AutoMapper/Volo/Abp/AutoMapper/AbpAutoMapperModule.cs @@ -17,13 +17,13 @@ namespace Volo.Abp.AutoMapper private static volatile bool _createdMappingsBefore; private static readonly object SyncObj = new object(); - public override void ConfigureServices(IServiceCollection services) + public override void ConfigureServices(ServiceConfigurationContext context) { - services.AddAssemblyOf(); + context.Services.AddAssemblyOf(); var mapperAccessor = new MapperAccessor(); - services.AddSingleton(_ => mapperAccessor); - services.AddSingleton(_ => mapperAccessor); + context.Services.AddSingleton(_ => mapperAccessor); + context.Services.AddSingleton(_ => mapperAccessor); } public override void OnApplicationInitialization(ApplicationInitializationContext context) diff --git a/framework/src/Volo.Abp.Caching/Volo/Abp/Caching/AbpCachingModule.cs b/framework/src/Volo.Abp.Caching/Volo/Abp/Caching/AbpCachingModule.cs index a1b9adbbb3..b69611426c 100644 --- a/framework/src/Volo.Abp.Caching/Volo/Abp/Caching/AbpCachingModule.cs +++ b/framework/src/Volo.Abp.Caching/Volo/Abp/Caching/AbpCachingModule.cs @@ -11,14 +11,14 @@ namespace Volo.Abp.Caching [DependsOn(typeof(AbpMultiTenancyAbstractionsModule))] public class AbpCachingModule : AbpModule { - public override void ConfigureServices(IServiceCollection services) + public override void ConfigureServices(ServiceConfigurationContext context) { - services.AddMemoryCache(); - services.AddDistributedMemoryCache(); + context.Services.AddMemoryCache(); + context.Services.AddDistributedMemoryCache(); - services.AddAssemblyOf(); + context.Services.AddAssemblyOf(); - services.AddSingleton(typeof(IDistributedCache<>), typeof(DistributedCache<>)); + context.Services.AddSingleton(typeof(IDistributedCache<>), typeof(DistributedCache<>)); } } } diff --git a/framework/src/Volo.Abp.Castle.Core/Volo/Abp/Castle/AbpCastleCoreModule.cs b/framework/src/Volo.Abp.Castle.Core/Volo/Abp/Castle/AbpCastleCoreModule.cs index d250aab5d0..0f9a10bda1 100644 --- a/framework/src/Volo.Abp.Castle.Core/Volo/Abp/Castle/AbpCastleCoreModule.cs +++ b/framework/src/Volo.Abp.Castle.Core/Volo/Abp/Castle/AbpCastleCoreModule.cs @@ -6,9 +6,9 @@ namespace Volo.Abp.Castle { public class AbpCastleCoreModule : AbpModule { - public override void ConfigureServices(IServiceCollection services) + public override void ConfigureServices(ServiceConfigurationContext context) { - services.AddTransient(typeof(CastleAbpInterceptorAdapter<>)); + context.Services.AddTransient(typeof(CastleAbpInterceptorAdapter<>)); } } } diff --git a/framework/src/Volo.Abp.Core/Volo/Abp/Modularity/AbpModule.cs b/framework/src/Volo.Abp.Core/Volo/Abp/Modularity/AbpModule.cs index 11f2cb3f34..276e3d4ecb 100644 --- a/framework/src/Volo.Abp.Core/Volo/Abp/Modularity/AbpModule.cs +++ b/framework/src/Volo.Abp.Core/Volo/Abp/Modularity/AbpModule.cs @@ -13,17 +13,17 @@ namespace Volo.Abp.Modularity IPreConfigureServices, IPostConfigureServices { - public virtual void PreConfigureServices(IServiceCollection services) + public virtual void PreConfigureServices(ServiceConfigurationContext context) { } - public virtual void ConfigureServices(IServiceCollection services) + public virtual void ConfigureServices(ServiceConfigurationContext context) { } - public virtual void PostConfigureServices(IServiceCollection services) + public virtual void PostConfigureServices(ServiceConfigurationContext context) { } diff --git a/framework/src/Volo.Abp.Core/Volo/Abp/Modularity/IAbpModule.cs b/framework/src/Volo.Abp.Core/Volo/Abp/Modularity/IAbpModule.cs index 8b8208495c..b58fdc8eed 100644 --- a/framework/src/Volo.Abp.Core/Volo/Abp/Modularity/IAbpModule.cs +++ b/framework/src/Volo.Abp.Core/Volo/Abp/Modularity/IAbpModule.cs @@ -6,6 +6,6 @@ namespace Volo.Abp.Modularity { public interface IAbpModule : ISingletonDependency { - void ConfigureServices([NotNull] IServiceCollection services); + void ConfigureServices(ServiceConfigurationContext context); } } diff --git a/framework/src/Volo.Abp.Core/Volo/Abp/Modularity/IPostConfigureServices.cs b/framework/src/Volo.Abp.Core/Volo/Abp/Modularity/IPostConfigureServices.cs index f28e78096e..f4b1d34eb0 100644 --- a/framework/src/Volo.Abp.Core/Volo/Abp/Modularity/IPostConfigureServices.cs +++ b/framework/src/Volo.Abp.Core/Volo/Abp/Modularity/IPostConfigureServices.cs @@ -4,6 +4,6 @@ namespace Volo.Abp.Modularity { public interface IPostConfigureServices { - void PostConfigureServices(IServiceCollection services); + void PostConfigureServices(ServiceConfigurationContext context); } } \ No newline at end of file diff --git a/framework/src/Volo.Abp.Core/Volo/Abp/Modularity/IPreConfigureServices.cs b/framework/src/Volo.Abp.Core/Volo/Abp/Modularity/IPreConfigureServices.cs index 4cd001098a..5536490ea4 100644 --- a/framework/src/Volo.Abp.Core/Volo/Abp/Modularity/IPreConfigureServices.cs +++ b/framework/src/Volo.Abp.Core/Volo/Abp/Modularity/IPreConfigureServices.cs @@ -4,6 +4,6 @@ namespace Volo.Abp.Modularity { public interface IPreConfigureServices { - void PreConfigureServices(IServiceCollection services); + void PreConfigureServices(ServiceConfigurationContext context); } } diff --git a/framework/src/Volo.Abp.Core/Volo/Abp/Modularity/ModuleLoader.cs b/framework/src/Volo.Abp.Core/Volo/Abp/Modularity/ModuleLoader.cs index 762cbde139..517c2fb862 100644 --- a/framework/src/Volo.Abp.Core/Volo/Abp/Modularity/ModuleLoader.cs +++ b/framework/src/Volo.Abp.Core/Volo/Abp/Modularity/ModuleLoader.cs @@ -91,22 +91,23 @@ namespace Volo.Abp.Modularity protected virtual void ConfigureServices(List modules, IServiceCollection services) { + var context = new ServiceConfigurationContext(services); //PreConfigureServices foreach (var module in modules.Where(m => m.Instance is IPreConfigureServices)) { - ((IPreConfigureServices)module.Instance).PreConfigureServices(services); + ((IPreConfigureServices)module.Instance).PreConfigureServices(context); } //ConfigureServices foreach (var module in modules) { - module.Instance.ConfigureServices(services); + module.Instance.ConfigureServices(context); } //IPostConfigureServices foreach (var module in modules.Where(m => m.Instance is IPostConfigureServices)) { - ((IPostConfigureServices)module.Instance).PostConfigureServices(services); + ((IPostConfigureServices)module.Instance).PostConfigureServices(context); } } diff --git a/framework/src/Volo.Abp.Data/Volo/Abp/Data/AbpDataModule.cs b/framework/src/Volo.Abp.Data/Volo/Abp/Data/AbpDataModule.cs index 244a70b80e..4e295a6875 100644 --- a/framework/src/Volo.Abp.Data/Volo/Abp/Data/AbpDataModule.cs +++ b/framework/src/Volo.Abp.Data/Volo/Abp/Data/AbpDataModule.cs @@ -5,11 +5,11 @@ namespace Volo.Abp.Data { public class AbpDataModule : AbpModule { - public override void ConfigureServices(IServiceCollection services) + public override void ConfigureServices(ServiceConfigurationContext context) { - services.AddSingleton(typeof(IDataFilter<>), typeof(DataFilter<>)); + context.Services.AddSingleton(typeof(IDataFilter<>), typeof(DataFilter<>)); - services.AddAssemblyOf(); + context.Services.AddAssemblyOf(); } } } diff --git a/framework/src/Volo.Abp.Ddd.Application/Volo/Abp/Application/AbpDddApplicationModule.cs b/framework/src/Volo.Abp.Ddd.Application/Volo/Abp/Application/AbpDddApplicationModule.cs index 89070267f4..6fb224a270 100644 --- a/framework/src/Volo.Abp.Ddd.Application/Volo/Abp/Application/AbpDddApplicationModule.cs +++ b/framework/src/Volo.Abp.Ddd.Application/Volo/Abp/Application/AbpDddApplicationModule.cs @@ -21,9 +21,9 @@ namespace Volo.Abp.Application [DependsOn(typeof(AbpHttpAbstractionsModule))] public class AbpDddApplicationModule : AbpModule { - public override void ConfigureServices(IServiceCollection services) + public override void ConfigureServices(ServiceConfigurationContext context) { - services.Configure(options => + context.Services.Configure(options => { options.IgnoredInterfaces.AddIfNotContains(typeof(IRemoteService)); options.IgnoredInterfaces.AddIfNotContains(typeof(IApplicationService)); @@ -31,7 +31,7 @@ namespace Volo.Abp.Application options.IgnoredInterfaces.AddIfNotContains(typeof(IAuthorizationEnabled)); //TODO: Move to it's own module if possible? }); - services.AddAssemblyOf(); + context.Services.AddAssemblyOf(); } } } diff --git a/framework/src/Volo.Abp.Ddd.Domain/Volo/Abp/Domain/AbpDddDomainModule.cs b/framework/src/Volo.Abp.Ddd.Domain/Volo/Abp/Domain/AbpDddDomainModule.cs index b8e306dbb5..581ed97592 100644 --- a/framework/src/Volo.Abp.Ddd.Domain/Volo/Abp/Domain/AbpDddDomainModule.cs +++ b/framework/src/Volo.Abp.Ddd.Domain/Volo/Abp/Domain/AbpDddDomainModule.cs @@ -22,9 +22,9 @@ namespace Volo.Abp.Domain typeof(AbpUnitOfWorkModule))] public class AbpDddDomainModule : AbpModule { - public override void ConfigureServices(IServiceCollection services) + public override void ConfigureServices(ServiceConfigurationContext context) { - services.AddAssemblyOf(); + context.Services.AddAssemblyOf(); } } } diff --git a/framework/src/Volo.Abp.Emailing/Volo/Abp/Emailing/AbpEmailingModule.cs b/framework/src/Volo.Abp.Emailing/Volo/Abp/Emailing/AbpEmailingModule.cs index 0ddd337d1a..afaf0b92fa 100644 --- a/framework/src/Volo.Abp.Emailing/Volo/Abp/Emailing/AbpEmailingModule.cs +++ b/framework/src/Volo.Abp.Emailing/Volo/Abp/Emailing/AbpEmailingModule.cs @@ -6,14 +6,14 @@ namespace Volo.Abp.Emailing { public class AbpEmailingModule : AbpModule { - public override void ConfigureServices(IServiceCollection services) + public override void ConfigureServices(ServiceConfigurationContext context) { - services.Configure(options => + context.Services.Configure(options => { options.DefinitionProviders.Add(); }); - services.AddAssemblyOf(); + context.Services.AddAssemblyOf(); } } } diff --git a/framework/src/Volo.Abp.EntityFrameworkCore.MySQL/Volo/Abp/EntityFrameworkCore/MySQL/AbpEntityFrameworkCoreMySQLModule.cs b/framework/src/Volo.Abp.EntityFrameworkCore.MySQL/Volo/Abp/EntityFrameworkCore/MySQL/AbpEntityFrameworkCoreMySQLModule.cs index 25f70d41db..de6687a112 100644 --- a/framework/src/Volo.Abp.EntityFrameworkCore.MySQL/Volo/Abp/EntityFrameworkCore/MySQL/AbpEntityFrameworkCoreMySQLModule.cs +++ b/framework/src/Volo.Abp.EntityFrameworkCore.MySQL/Volo/Abp/EntityFrameworkCore/MySQL/AbpEntityFrameworkCoreMySQLModule.cs @@ -8,9 +8,9 @@ namespace Volo.Abp.EntityFrameworkCore.MySQL )] public class AbpEntityFrameworkCoreMySQLModule : AbpModule { - public override void ConfigureServices(IServiceCollection services) + public override void ConfigureServices(ServiceConfigurationContext context) { - services.AddAssemblyOf(); + context.Services.AddAssemblyOf(); } } } diff --git a/framework/src/Volo.Abp.EntityFrameworkCore.SqlServer/Volo/Abp/EntityFrameworkCore/SqlServer/AbpEntityFrameworkCoreSqlServerModule.cs b/framework/src/Volo.Abp.EntityFrameworkCore.SqlServer/Volo/Abp/EntityFrameworkCore/SqlServer/AbpEntityFrameworkCoreSqlServerModule.cs index bafe744f4d..7cbcc456f3 100644 --- a/framework/src/Volo.Abp.EntityFrameworkCore.SqlServer/Volo/Abp/EntityFrameworkCore/SqlServer/AbpEntityFrameworkCoreSqlServerModule.cs +++ b/framework/src/Volo.Abp.EntityFrameworkCore.SqlServer/Volo/Abp/EntityFrameworkCore/SqlServer/AbpEntityFrameworkCoreSqlServerModule.cs @@ -8,9 +8,9 @@ namespace Volo.Abp.EntityFrameworkCore.SqlServer )] public class AbpEntityFrameworkCoreSqlServerModule : AbpModule { - public override void ConfigureServices(IServiceCollection services) + public override void ConfigureServices(ServiceConfigurationContext context) { - services.AddAssemblyOf(); + context.Services.AddAssemblyOf(); } } } diff --git a/framework/src/Volo.Abp.EntityFrameworkCore/Volo/Abp/EntityFrameworkCore/AbpEntityFrameworkCoreModule.cs b/framework/src/Volo.Abp.EntityFrameworkCore/Volo/Abp/EntityFrameworkCore/AbpEntityFrameworkCoreModule.cs index 299a74eef3..dfd770432c 100644 --- a/framework/src/Volo.Abp.EntityFrameworkCore/Volo/Abp/EntityFrameworkCore/AbpEntityFrameworkCoreModule.cs +++ b/framework/src/Volo.Abp.EntityFrameworkCore/Volo/Abp/EntityFrameworkCore/AbpEntityFrameworkCoreModule.cs @@ -10,13 +10,13 @@ namespace Volo.Abp.EntityFrameworkCore [DependsOn(typeof(AbpDddDomainModule))] public class AbpEntityFrameworkCoreModule : AbpModule { - public override void ConfigureServices(IServiceCollection services) + public override void ConfigureServices(ServiceConfigurationContext context) { - services.Configure(options => + context.Services.Configure(options => { - options.PreConfigure(context => + options.PreConfigure(abpDbContextConfigurationContext => { - context.DbContextOptions + abpDbContextConfigurationContext.DbContextOptions .ConfigureWarnings(warnings => { warnings.Ignore(CoreEventId.LazyLoadOnDisposedContextWarning); @@ -24,8 +24,8 @@ namespace Volo.Abp.EntityFrameworkCore }); }); - services.TryAddTransient(typeof(IDbContextProvider<>), typeof(UnitOfWorkDbContextProvider<>)); - services.AddAssemblyOf(); + context.Services.TryAddTransient(typeof(IDbContextProvider<>), typeof(UnitOfWorkDbContextProvider<>)); + context.Services.AddAssemblyOf(); } } } diff --git a/framework/src/Volo.Abp.EventBus.Distributed.RabbitMQ/Volo/Abp/EventBus/Distributed/RabbitMq/AbpRabbitMqDistributedEventBusModule.cs b/framework/src/Volo.Abp.EventBus.Distributed.RabbitMQ/Volo/Abp/EventBus/Distributed/RabbitMq/AbpRabbitMqDistributedEventBusModule.cs index 753438a5b0..888370e0db 100644 --- a/framework/src/Volo.Abp.EventBus.Distributed.RabbitMQ/Volo/Abp/EventBus/Distributed/RabbitMq/AbpRabbitMqDistributedEventBusModule.cs +++ b/framework/src/Volo.Abp.EventBus.Distributed.RabbitMQ/Volo/Abp/EventBus/Distributed/RabbitMq/AbpRabbitMqDistributedEventBusModule.cs @@ -6,9 +6,9 @@ namespace Volo.Abp.EventBus.Distributed.RabbitMq [DependsOn(typeof(AbpDistributedEventBusModule))] public class AbpRabbitMqDistributedEventBusModule : AbpModule { - public override void ConfigureServices(IServiceCollection services) + public override void ConfigureServices(ServiceConfigurationContext context) { - services.AddAssemblyOf(); + context.Services.AddAssemblyOf(); } } } diff --git a/framework/src/Volo.Abp.EventBus.Distributed/Volo/Abp/EventBus/Distributed/AbpDistributedEventBusModule.cs b/framework/src/Volo.Abp.EventBus.Distributed/Volo/Abp/EventBus/Distributed/AbpDistributedEventBusModule.cs index 0494913d12..57ea9bed6e 100644 --- a/framework/src/Volo.Abp.EventBus.Distributed/Volo/Abp/EventBus/Distributed/AbpDistributedEventBusModule.cs +++ b/framework/src/Volo.Abp.EventBus.Distributed/Volo/Abp/EventBus/Distributed/AbpDistributedEventBusModule.cs @@ -6,9 +6,9 @@ namespace Volo.Abp.EventBus.Distributed [DependsOn(typeof(AbpEventBusModule))] public class AbpDistributedEventBusModule : AbpModule { - public override void ConfigureServices(IServiceCollection services) + public override void ConfigureServices(ServiceConfigurationContext context) { - services.AddAssemblyOf(); + context.Services.AddAssemblyOf(); } } } diff --git a/framework/src/Volo.Abp.EventBus/Volo/Abp/EventBus/AbpEventBusModule.cs b/framework/src/Volo.Abp.EventBus/Volo/Abp/EventBus/AbpEventBusModule.cs index d37882560f..60d42d6453 100644 --- a/framework/src/Volo.Abp.EventBus/Volo/Abp/EventBus/AbpEventBusModule.cs +++ b/framework/src/Volo.Abp.EventBus/Volo/Abp/EventBus/AbpEventBusModule.cs @@ -8,14 +8,14 @@ namespace Volo.Abp.EventBus { public class AbpEventBusModule : AbpModule { - public override void PreConfigureServices(IServiceCollection services) + public override void PreConfigureServices(ServiceConfigurationContext context) { - AddEventHandlers(services); + AddEventHandlers(context.Services); } - public override void ConfigureServices(IServiceCollection services) + public override void ConfigureServices(ServiceConfigurationContext context) { - services.AddAssemblyOf(); + context.Services.AddAssemblyOf(); } private static void AddEventHandlers(IServiceCollection services) diff --git a/framework/src/Volo.Abp.Guids/Volo/Abp/Guids/AbpGuidsModule.cs b/framework/src/Volo.Abp.Guids/Volo/Abp/Guids/AbpGuidsModule.cs index 391d89576b..36a1ac4f9e 100644 --- a/framework/src/Volo.Abp.Guids/Volo/Abp/Guids/AbpGuidsModule.cs +++ b/framework/src/Volo.Abp.Guids/Volo/Abp/Guids/AbpGuidsModule.cs @@ -5,9 +5,9 @@ namespace Volo.Abp.Guids { public class AbpGuidsModule : AbpModule { - public override void ConfigureServices(IServiceCollection services) + public override void ConfigureServices(ServiceConfigurationContext context) { - services.AddAssemblyOf(); + context.Services.AddAssemblyOf(); } } } diff --git a/framework/src/Volo.Abp.Http.Abstractions/Volo/Abp/Http/AbpHttpAbstractionsModule.cs b/framework/src/Volo.Abp.Http.Abstractions/Volo/Abp/Http/AbpHttpAbstractionsModule.cs index bc52ce811b..922064eec4 100644 --- a/framework/src/Volo.Abp.Http.Abstractions/Volo/Abp/Http/AbpHttpAbstractionsModule.cs +++ b/framework/src/Volo.Abp.Http.Abstractions/Volo/Abp/Http/AbpHttpAbstractionsModule.cs @@ -5,9 +5,9 @@ namespace Volo.Abp.Http { public class AbpHttpAbstractionsModule : AbpModule { - public override void ConfigureServices(IServiceCollection services) + public override void ConfigureServices(ServiceConfigurationContext context) { - services.AddAssemblyOf(); + context.Services.AddAssemblyOf(); } } } diff --git a/framework/src/Volo.Abp.Http.Client/Volo/Abp/Http/Client/AbpHttpClientModule.cs b/framework/src/Volo.Abp.Http.Client/Volo/Abp/Http/Client/AbpHttpClientModule.cs index ad2b76b989..7e7df30dd1 100644 --- a/framework/src/Volo.Abp.Http.Client/Volo/Abp/Http/Client/AbpHttpClientModule.cs +++ b/framework/src/Volo.Abp.Http.Client/Volo/Abp/Http/Client/AbpHttpClientModule.cs @@ -8,9 +8,9 @@ namespace Volo.Abp.Http.Client [DependsOn(typeof(AbpCastleCoreModule))] public class AbpHttpClientModule : AbpModule { - public override void ConfigureServices(IServiceCollection services) + public override void ConfigureServices(ServiceConfigurationContext context) { - services.AddAssemblyOf(); + context.Services.AddAssemblyOf(); } } } diff --git a/framework/src/Volo.Abp.Http/Volo/Abp/Http/AbpHttpModule.cs b/framework/src/Volo.Abp.Http/Volo/Abp/Http/AbpHttpModule.cs index d164cd2b31..6b9082b61d 100644 --- a/framework/src/Volo.Abp.Http/Volo/Abp/Http/AbpHttpModule.cs +++ b/framework/src/Volo.Abp.Http/Volo/Abp/Http/AbpHttpModule.cs @@ -10,11 +10,11 @@ namespace Volo.Abp.Http [DependsOn(typeof(AbpJsonModule))] public class AbpHttpModule : AbpModule { - public override void ConfigureServices(IServiceCollection services) + public override void ConfigureServices(ServiceConfigurationContext context) { - services.AddAssemblyOf(); + context.Services.AddAssemblyOf(); - services.Configure(options => + context.Services.Configure(options => { options.Generators[JQueryProxyScriptGenerator.Name] = typeof(JQueryProxyScriptGenerator); }); diff --git a/framework/src/Volo.Abp.Json/Volo/Abp/Json/AbpJsonModule.cs b/framework/src/Volo.Abp.Json/Volo/Abp/Json/AbpJsonModule.cs index d732121b02..2db93a8cca 100644 --- a/framework/src/Volo.Abp.Json/Volo/Abp/Json/AbpJsonModule.cs +++ b/framework/src/Volo.Abp.Json/Volo/Abp/Json/AbpJsonModule.cs @@ -7,9 +7,9 @@ namespace Volo.Abp.Json [DependsOn(typeof(AbpTimingModule))] public class AbpJsonModule : AbpModule { - public override void ConfigureServices(IServiceCollection services) + public override void ConfigureServices(ServiceConfigurationContext context) { - services.AddAssemblyOf(); + context.Services.AddAssemblyOf(); } } } diff --git a/framework/src/Volo.Abp.Localization/Volo/Abp/Localization/AbpLocalizationModule.cs b/framework/src/Volo.Abp.Localization/Volo/Abp/Localization/AbpLocalizationModule.cs index 85dc4b42d5..9ceaf569ac 100644 --- a/framework/src/Volo.Abp.Localization/Volo/Abp/Localization/AbpLocalizationModule.cs +++ b/framework/src/Volo.Abp.Localization/Volo/Abp/Localization/AbpLocalizationModule.cs @@ -8,23 +8,23 @@ namespace Volo.Abp.Localization [DependsOn(typeof(AbpVirtualFileSystemModule))] public class AbpLocalizationModule : AbpModule { - public override void ConfigureServices(IServiceCollection services) + public override void ConfigureServices(ServiceConfigurationContext context) { - AbpStringLocalizerFactory.Replace(services); + AbpStringLocalizerFactory.Replace(context.Services); - services.Configure(options => + context.Services.Configure(options => { options.FileSets.AddEmbedded("Volo.Abp", "Volo/Abp"); }); - services.Configure(options => + context.Services.Configure(options => { options.Resources .Add("en") .AddVirtualJson("/Localization/Resources/AbpValidation"); }); - services.AddAssemblyOf(); + context.Services.AddAssemblyOf(); } } } diff --git a/framework/src/Volo.Abp.MemoryDb/Volo/Abp/MemoryDb/AbpMemoryDbModule.cs b/framework/src/Volo.Abp.MemoryDb/Volo/Abp/MemoryDb/AbpMemoryDbModule.cs index e9501fbf32..80e499e9ed 100644 --- a/framework/src/Volo.Abp.MemoryDb/Volo/Abp/MemoryDb/AbpMemoryDbModule.cs +++ b/framework/src/Volo.Abp.MemoryDb/Volo/Abp/MemoryDb/AbpMemoryDbModule.cs @@ -12,10 +12,10 @@ namespace Volo.Abp.MemoryDb [DependsOn(typeof(AbpDddDomainModule))] public class AbpMemoryDbModule : AbpModule { - public override void ConfigureServices(IServiceCollection services) + public override void ConfigureServices(ServiceConfigurationContext context) { - services.TryAddTransient(typeof(IMemoryDatabaseProvider<>), typeof(UnitOfWorkMemoryDatabaseProvider<>)); - services.AddAssemblyOf(); + context.Services.TryAddTransient(typeof(IMemoryDatabaseProvider<>), typeof(UnitOfWorkMemoryDatabaseProvider<>)); + context.Services.AddAssemblyOf(); } } } diff --git a/framework/src/Volo.Abp.MongoDB/Volo/Abp/MongoDB/AbpMongoDbModule.cs b/framework/src/Volo.Abp.MongoDB/Volo/Abp/MongoDB/AbpMongoDbModule.cs index c4712065aa..faaebf1942 100644 --- a/framework/src/Volo.Abp.MongoDB/Volo/Abp/MongoDB/AbpMongoDbModule.cs +++ b/framework/src/Volo.Abp.MongoDB/Volo/Abp/MongoDB/AbpMongoDbModule.cs @@ -9,10 +9,10 @@ namespace Volo.Abp.MongoDB [DependsOn(typeof(AbpDddDomainModule))] public class AbpMongoDbModule : AbpModule { - public override void ConfigureServices(IServiceCollection services) + public override void ConfigureServices(ServiceConfigurationContext context) { - services.TryAddTransient(typeof(IMongoDbContextProvider<>), typeof(UnitOfWorkMongoDbContextProvider<>)); - services.AddAssemblyOf(); + context.Services.TryAddTransient(typeof(IMongoDbContextProvider<>), typeof(UnitOfWorkMongoDbContextProvider<>)); + context.Services.AddAssemblyOf(); } } } diff --git a/framework/src/Volo.Abp.MultiTenancy.Abstractions/Volo/Abp/MultiTenancy/AbpMultiTenancyAbstractionsModule.cs b/framework/src/Volo.Abp.MultiTenancy.Abstractions/Volo/Abp/MultiTenancy/AbpMultiTenancyAbstractionsModule.cs index 336369dd35..1d8d6ecb52 100644 --- a/framework/src/Volo.Abp.MultiTenancy.Abstractions/Volo/Abp/MultiTenancy/AbpMultiTenancyAbstractionsModule.cs +++ b/framework/src/Volo.Abp.MultiTenancy.Abstractions/Volo/Abp/MultiTenancy/AbpMultiTenancyAbstractionsModule.cs @@ -9,14 +9,14 @@ namespace Volo.Abp.MultiTenancy [DependsOn(typeof(AbpSettingsModule))] public class AbpMultiTenancyAbstractionsModule : AbpModule //TODO: Rename to AbpMultiTenancyModule { - public override void ConfigureServices(IServiceCollection services) + public override void ConfigureServices(ServiceConfigurationContext context) { - services.Configure(options => + context.Services.Configure(options => { options.ValueProviders.Add(); }); - services.AddAssemblyOf(); + context.Services.AddAssemblyOf(); } } } diff --git a/framework/src/Volo.Abp.ObjectMapping/Volo/Abp/ObjectMapping/AbpObjectMappingModule.cs b/framework/src/Volo.Abp.ObjectMapping/Volo/Abp/ObjectMapping/AbpObjectMappingModule.cs index 3128f2ad9e..8ac3928b7a 100644 --- a/framework/src/Volo.Abp.ObjectMapping/Volo/Abp/ObjectMapping/AbpObjectMappingModule.cs +++ b/framework/src/Volo.Abp.ObjectMapping/Volo/Abp/ObjectMapping/AbpObjectMappingModule.cs @@ -6,23 +6,23 @@ namespace Volo.Abp.ObjectMapping { public class AbpObjectMappingModule : AbpModule { - public override void PreConfigureServices(IServiceCollection services) + public override void PreConfigureServices(ServiceConfigurationContext context) { - services.OnExposing(context => + context.Services.OnExposing(onServiceExposingContext => { //Register types for IObjectMapper if implements - context.ExposedTypes.AddRange( + onServiceExposingContext.ExposedTypes.AddRange( ReflectionHelper.GetImplementedGenericTypes( - context.ImplementationType, + onServiceExposingContext.ImplementationType, typeof(IObjectMapper<,>) ) ); }); } - public override void ConfigureServices(IServiceCollection services) + public override void ConfigureServices(ServiceConfigurationContext context) { - services.AddAssemblyOf(); + context.Services.AddAssemblyOf(); } } } diff --git a/framework/src/Volo.Abp.Security/Volo/Abp/Security/AbpSecurityModule.cs b/framework/src/Volo.Abp.Security/Volo/Abp/Security/AbpSecurityModule.cs index 7ea4caa5f0..745a633fe9 100644 --- a/framework/src/Volo.Abp.Security/Volo/Abp/Security/AbpSecurityModule.cs +++ b/framework/src/Volo.Abp.Security/Volo/Abp/Security/AbpSecurityModule.cs @@ -5,9 +5,9 @@ namespace Volo.Abp.Security { public class AbpSecurityModule : AbpModule { - public override void ConfigureServices(IServiceCollection services) + public override void ConfigureServices(ServiceConfigurationContext context) { - services.AddAssemblyOf(); + context.Services.AddAssemblyOf(); } } } diff --git a/framework/src/Volo.Abp.Serialization/Volo/Abp/Serialization/AbpSerializationModule.cs b/framework/src/Volo.Abp.Serialization/Volo/Abp/Serialization/AbpSerializationModule.cs index e32cce6d64..0f9cbe8159 100644 --- a/framework/src/Volo.Abp.Serialization/Volo/Abp/Serialization/AbpSerializationModule.cs +++ b/framework/src/Volo.Abp.Serialization/Volo/Abp/Serialization/AbpSerializationModule.cs @@ -6,23 +6,23 @@ namespace Volo.Abp.Serialization { public class AbpSerializationModule : AbpModule { - public override void PreConfigureServices(IServiceCollection services) + public override void PreConfigureServices(ServiceConfigurationContext context) { - services.OnExposing(context => + context.Services.OnExposing(onServiceExposingContext => { //Register types for IObjectSerializer if implements - context.ExposedTypes.AddRange( + onServiceExposingContext.ExposedTypes.AddRange( ReflectionHelper.GetImplementedGenericTypes( - context.ImplementationType, + onServiceExposingContext.ImplementationType, typeof(IObjectSerializer<>) ) ); }); } - public override void ConfigureServices(IServiceCollection services) + public override void ConfigureServices(ServiceConfigurationContext context) { - services.AddAssemblyOf(); + context.Services.AddAssemblyOf(); } } } diff --git a/framework/src/Volo.Abp.Settings/Volo/Abp/Settings/AbpSettingsModule.cs b/framework/src/Volo.Abp.Settings/Volo/Abp/Settings/AbpSettingsModule.cs index 0018d495a4..bf00c590d2 100644 --- a/framework/src/Volo.Abp.Settings/Volo/Abp/Settings/AbpSettingsModule.cs +++ b/framework/src/Volo.Abp.Settings/Volo/Abp/Settings/AbpSettingsModule.cs @@ -5,9 +5,9 @@ namespace Volo.Abp.Settings { public class AbpSettingsModule : AbpModule { - public override void ConfigureServices(IServiceCollection services) + public override void ConfigureServices(ServiceConfigurationContext context) { - services.AddAssemblyOf(); + context.Services.AddAssemblyOf(); } } } diff --git a/framework/src/Volo.Abp.Sms/Volo/Abp/Sms/AbpSmsModule.cs b/framework/src/Volo.Abp.Sms/Volo/Abp/Sms/AbpSmsModule.cs index 33464dead8..da7e2bbd81 100644 --- a/framework/src/Volo.Abp.Sms/Volo/Abp/Sms/AbpSmsModule.cs +++ b/framework/src/Volo.Abp.Sms/Volo/Abp/Sms/AbpSmsModule.cs @@ -5,9 +5,9 @@ namespace Volo.Abp.Sms { public class AbpSmsModule : AbpModule { - public override void ConfigureServices(IServiceCollection services) + public override void ConfigureServices(ServiceConfigurationContext context) { - services.AddAssemblyOf(); + context.Services.AddAssemblyOf(); } } } diff --git a/framework/src/Volo.Abp.TestBase/Volo/Abp/AbpTestBaseModule.cs b/framework/src/Volo.Abp.TestBase/Volo/Abp/AbpTestBaseModule.cs index 5ff26f7a12..d956149842 100644 --- a/framework/src/Volo.Abp.TestBase/Volo/Abp/AbpTestBaseModule.cs +++ b/framework/src/Volo.Abp.TestBase/Volo/Abp/AbpTestBaseModule.cs @@ -5,7 +5,7 @@ namespace Volo.Abp { public class AbpTestBaseModule : AbpModule { - public override void ConfigureServices(IServiceCollection services) + public override void ConfigureServices(ServiceConfigurationContext context) { } diff --git a/framework/src/Volo.Abp.Threading/Volo/Abp/Threading/AbpThreadingModule.cs b/framework/src/Volo.Abp.Threading/Volo/Abp/Threading/AbpThreadingModule.cs index fd54f380ac..226ec6d5fb 100644 --- a/framework/src/Volo.Abp.Threading/Volo/Abp/Threading/AbpThreadingModule.cs +++ b/framework/src/Volo.Abp.Threading/Volo/Abp/Threading/AbpThreadingModule.cs @@ -5,11 +5,11 @@ namespace Volo.Abp.Threading { public class AbpThreadingModule : AbpModule { - public override void ConfigureServices(IServiceCollection services) + public override void ConfigureServices(ServiceConfigurationContext context) { - services.AddSingleton(NullCancellationTokenProvider.Instance); + context.Services.AddSingleton(NullCancellationTokenProvider.Instance); - services.AddAssemblyOf(); + context.Services.AddAssemblyOf(); } } } diff --git a/framework/src/Volo.Abp.Timing/Volo/Abp/Timing/AbpTimingModule.cs b/framework/src/Volo.Abp.Timing/Volo/Abp/Timing/AbpTimingModule.cs index 8c80cb732b..9d88f5ecaa 100644 --- a/framework/src/Volo.Abp.Timing/Volo/Abp/Timing/AbpTimingModule.cs +++ b/framework/src/Volo.Abp.Timing/Volo/Abp/Timing/AbpTimingModule.cs @@ -5,9 +5,9 @@ namespace Volo.Abp.Timing { public class AbpTimingModule : AbpModule { - public override void ConfigureServices(IServiceCollection services) + public override void ConfigureServices(ServiceConfigurationContext context) { - services.AddAssemblyOf(); + context.Services.AddAssemblyOf(); } } } diff --git a/framework/src/Volo.Abp.UI.Navigation/Volo/Abp/Ui/Navigation/AbpUiNavigationModule.cs b/framework/src/Volo.Abp.UI.Navigation/Volo/Abp/Ui/Navigation/AbpUiNavigationModule.cs index a7957f07c9..6c37ba14c7 100644 --- a/framework/src/Volo.Abp.UI.Navigation/Volo/Abp/Ui/Navigation/AbpUiNavigationModule.cs +++ b/framework/src/Volo.Abp.UI.Navigation/Volo/Abp/Ui/Navigation/AbpUiNavigationModule.cs @@ -6,9 +6,9 @@ namespace Volo.Abp.UI.Navigation [DependsOn(typeof(AbpUiModule))] public class AbpUiNavigationModule : AbpModule { - public override void ConfigureServices(IServiceCollection services) + public override void ConfigureServices(ServiceConfigurationContext context) { - services.AddAssemblyOf(); + context.Services.AddAssemblyOf(); } } } diff --git a/framework/src/Volo.Abp.UI/Volo/Abp/Ui/AbpUiModule.cs b/framework/src/Volo.Abp.UI/Volo/Abp/Ui/AbpUiModule.cs index 6e61b65831..20228d5a6d 100644 --- a/framework/src/Volo.Abp.UI/Volo/Abp/Ui/AbpUiModule.cs +++ b/framework/src/Volo.Abp.UI/Volo/Abp/Ui/AbpUiModule.cs @@ -11,19 +11,19 @@ namespace Volo.Abp.UI )] public class AbpUiModule : AbpModule { - public override void ConfigureServices(IServiceCollection services) + public override void ConfigureServices(ServiceConfigurationContext context) { - services.Configure(options => + context.Services.Configure(options => { options.FileSets.AddEmbedded(); }); - services.Configure(options => + context.Services.Configure(options => { options.Resources.Add("en").AddVirtualJson("/Localization/Resources/AbpUi"); }); - services.AddAssemblyOf(); + context.Services.AddAssemblyOf(); } } } diff --git a/framework/src/Volo.Abp.Uow/Volo/Abp/Uow/AbpUnitOfWorkModule.cs b/framework/src/Volo.Abp.Uow/Volo/Abp/Uow/AbpUnitOfWorkModule.cs index 37ff997fdd..2ff058ec3f 100644 --- a/framework/src/Volo.Abp.Uow/Volo/Abp/Uow/AbpUnitOfWorkModule.cs +++ b/framework/src/Volo.Abp.Uow/Volo/Abp/Uow/AbpUnitOfWorkModule.cs @@ -5,14 +5,14 @@ namespace Volo.Abp.Uow { public class AbpUnitOfWorkModule : AbpModule { - public override void PreConfigureServices(IServiceCollection services) + public override void PreConfigureServices(ServiceConfigurationContext context) { - services.OnRegistred(UnitOfWorkInterceptorRegistrar.RegisterIfNeeded); + context.Services.OnRegistred(UnitOfWorkInterceptorRegistrar.RegisterIfNeeded); } - public override void ConfigureServices(IServiceCollection services) + public override void ConfigureServices(ServiceConfigurationContext context) { - services.AddAssemblyOf(); + context.Services.AddAssemblyOf(); } } } diff --git a/framework/src/Volo.Abp.Validation/Volo/Abp/Validation/AbpValidationModule.cs b/framework/src/Volo.Abp.Validation/Volo/Abp/Validation/AbpValidationModule.cs index 9bb38fbe7c..c110dd8fde 100644 --- a/framework/src/Volo.Abp.Validation/Volo/Abp/Validation/AbpValidationModule.cs +++ b/framework/src/Volo.Abp.Validation/Volo/Abp/Validation/AbpValidationModule.cs @@ -5,14 +5,14 @@ namespace Volo.Abp.Validation { public class AbpValidationModule : AbpModule { - public override void PreConfigureServices(IServiceCollection services) + public override void PreConfigureServices(ServiceConfigurationContext context) { - services.OnRegistred(ValidationInterceptorRegistrar.RegisterIfNeeded); + context.Services.OnRegistred(ValidationInterceptorRegistrar.RegisterIfNeeded); } - public override void ConfigureServices(IServiceCollection services) + public override void ConfigureServices(ServiceConfigurationContext context) { - services.AddAssemblyOf(); + context.Services.AddAssemblyOf(); } } } diff --git a/framework/src/Volo.Abp.VirtualFileSystem/Volo/Abp/VirtualFileSystem/AbpVirtualFileSystemModule.cs b/framework/src/Volo.Abp.VirtualFileSystem/Volo/Abp/VirtualFileSystem/AbpVirtualFileSystemModule.cs index cef8ab811e..ace58f8b51 100644 --- a/framework/src/Volo.Abp.VirtualFileSystem/Volo/Abp/VirtualFileSystem/AbpVirtualFileSystemModule.cs +++ b/framework/src/Volo.Abp.VirtualFileSystem/Volo/Abp/VirtualFileSystem/AbpVirtualFileSystemModule.cs @@ -5,9 +5,9 @@ namespace Volo.Abp.VirtualFileSystem { public class AbpVirtualFileSystemModule : AbpModule { - public override void ConfigureServices(IServiceCollection services) + public override void ConfigureServices(ServiceConfigurationContext context) { - services.AddAssemblyOf(); + context.Services.AddAssemblyOf(); } } } diff --git a/framework/test/SimpleConsoleDemo/Program.cs b/framework/test/SimpleConsoleDemo/Program.cs index 8193538354..27706872d8 100644 --- a/framework/test/SimpleConsoleDemo/Program.cs +++ b/framework/test/SimpleConsoleDemo/Program.cs @@ -32,9 +32,9 @@ namespace SimpleConsoleDemo public class MyConsoleModule : AbpModule { - public override void ConfigureServices(IServiceCollection services) + public override void ConfigureServices(ServiceConfigurationContext context) { - services.AddAssemblyOf(); + context.Services.AddAssemblyOf(); } } diff --git a/framework/test/Volo.Abp.AspNetCore.MultiTenancy.Tests/Volo/Abp/AspNetCore/App/AppModule.cs b/framework/test/Volo.Abp.AspNetCore.MultiTenancy.Tests/Volo/Abp/AspNetCore/App/AppModule.cs index 235fe34618..ccdb332aef 100644 --- a/framework/test/Volo.Abp.AspNetCore.MultiTenancy.Tests/Volo/Abp/AspNetCore/App/AppModule.cs +++ b/framework/test/Volo.Abp.AspNetCore.MultiTenancy.Tests/Volo/Abp/AspNetCore/App/AppModule.cs @@ -17,9 +17,9 @@ namespace Volo.Abp.AspNetCore.App )] public class AppModule : AbpModule { - public override void ConfigureServices(IServiceCollection services) + public override void ConfigureServices(ServiceConfigurationContext context) { - services.Configure(options => + context.Services.Configure(options => { options.AddDomainTenantResolver("{0}.abp.io"); }); diff --git a/framework/test/Volo.Abp.AspNetCore.Mvc.Tests/Volo/Abp/AspNetCore/Mvc/AbpAspNetCoreMvcTestModule.cs b/framework/test/Volo.Abp.AspNetCore.Mvc.Tests/Volo/Abp/AspNetCore/Mvc/AbpAspNetCoreMvcTestModule.cs index 9b284263bf..7d618e73db 100644 --- a/framework/test/Volo.Abp.AspNetCore.Mvc.Tests/Volo/Abp/AspNetCore/Mvc/AbpAspNetCoreMvcTestModule.cs +++ b/framework/test/Volo.Abp.AspNetCore.Mvc.Tests/Volo/Abp/AspNetCore/Mvc/AbpAspNetCoreMvcTestModule.cs @@ -20,11 +20,11 @@ namespace Volo.Abp.AspNetCore.Mvc )] public class AbpAspNetCoreMvcTestModule : AbpModule { - public override void ConfigureServices(IServiceCollection services) + public override void ConfigureServices(ServiceConfigurationContext context) { - services.AddLocalization(); //TODO: Move to the framework..? + context.Services.AddLocalization(); //TODO: Move to the framework..? - services.AddAuthorization(options => + context.Services.AddAuthorization(options => { options.AddPolicy("MyClaimTestPolicy", policy => { @@ -32,23 +32,23 @@ namespace Volo.Abp.AspNetCore.Mvc }); }); - services.Configure(options => + context.Services.Configure(options => { options.ConventionalControllers.Create(typeof(TestAppModule).Assembly, opts => { - opts.UrlActionNameNormalizer = context => - string.Equals(context.ActionNameInUrl, "phone", StringComparison.OrdinalIgnoreCase) + opts.UrlActionNameNormalizer = urlActionNameNormalizerContext => + string.Equals(urlActionNameNormalizerContext.ActionNameInUrl, "phone", StringComparison.OrdinalIgnoreCase) ? "phones" - : context.ActionNameInUrl; + : urlActionNameNormalizerContext.ActionNameInUrl; }); }); - services.Configure(options => + context.Services.Configure(options => { options.DefinitionProviders.Add(); }); - services.AddAssemblyOf(); + context.Services.AddAssemblyOf(); } public override void OnApplicationInitialization(ApplicationInitializationContext context) diff --git a/framework/test/Volo.Abp.AspNetCore.Mvc.UI.Bootstrap.Demo.Tests/Volo/Abp/AspNetCore/Mvc/UI/Bootstrap/Demo/AbpAspNetCoreMvcUiBootstrapDemoTestModule.cs b/framework/test/Volo.Abp.AspNetCore.Mvc.UI.Bootstrap.Demo.Tests/Volo/Abp/AspNetCore/Mvc/UI/Bootstrap/Demo/AbpAspNetCoreMvcUiBootstrapDemoTestModule.cs index 920571f4f0..01a2828867 100644 --- a/framework/test/Volo.Abp.AspNetCore.Mvc.UI.Bootstrap.Demo.Tests/Volo/Abp/AspNetCore/Mvc/UI/Bootstrap/Demo/AbpAspNetCoreMvcUiBootstrapDemoTestModule.cs +++ b/framework/test/Volo.Abp.AspNetCore.Mvc.UI.Bootstrap.Demo.Tests/Volo/Abp/AspNetCore/Mvc/UI/Bootstrap/Demo/AbpAspNetCoreMvcUiBootstrapDemoTestModule.cs @@ -10,9 +10,9 @@ namespace Volo.Abp.AspNetCore.Mvc.UI.Bootstrap.Demo )] public class AbpAspNetCoreMvcUiBootstrapDemoTestModule : AbpModule { - public override void ConfigureServices(IServiceCollection services) + public override void ConfigureServices(ServiceConfigurationContext context) { - services.AddAssemblyOf(); + context.Services.AddAssemblyOf(); } } } diff --git a/framework/test/Volo.Abp.AspNetCore.Mvc.UI.Bootstrap.Demo/AbpAspNetCoreMvcUiBootstrapDemoModule.cs b/framework/test/Volo.Abp.AspNetCore.Mvc.UI.Bootstrap.Demo/AbpAspNetCoreMvcUiBootstrapDemoModule.cs index f4b2d836c2..18386eac9c 100644 --- a/framework/test/Volo.Abp.AspNetCore.Mvc.UI.Bootstrap.Demo/AbpAspNetCoreMvcUiBootstrapDemoModule.cs +++ b/framework/test/Volo.Abp.AspNetCore.Mvc.UI.Bootstrap.Demo/AbpAspNetCoreMvcUiBootstrapDemoModule.cs @@ -14,9 +14,9 @@ namespace Volo.Abp.AspNetCore.Mvc.UI.Bootstrap.Demo )] public class AbpAspNetCoreMvcUiBootstrapDemoModule : AbpModule { - public override void ConfigureServices(IServiceCollection services) + public override void ConfigureServices(ServiceConfigurationContext context) { - services.AddAssemblyOf(); + context.Services.AddAssemblyOf(); } public override void OnApplicationInitialization(ApplicationInitializationContext context) diff --git a/framework/test/Volo.Abp.AspNetCore.Mvc.UI.Tests/Volo/Abp/AspNetCore/Mvc/UI/AbpAspNetCoreMvcUiTestModule.cs b/framework/test/Volo.Abp.AspNetCore.Mvc.UI.Tests/Volo/Abp/AspNetCore/Mvc/UI/AbpAspNetCoreMvcUiTestModule.cs index 3daf708a07..2d752f8d80 100644 --- a/framework/test/Volo.Abp.AspNetCore.Mvc.UI.Tests/Volo/Abp/AspNetCore/Mvc/UI/AbpAspNetCoreMvcUiTestModule.cs +++ b/framework/test/Volo.Abp.AspNetCore.Mvc.UI.Tests/Volo/Abp/AspNetCore/Mvc/UI/AbpAspNetCoreMvcUiTestModule.cs @@ -13,9 +13,9 @@ namespace Volo.Abp.AspNetCore.Mvc.UI )] public class AbpAspNetCoreMvcUiTestModule : AbpModule { - public override void ConfigureServices(IServiceCollection services) + public override void ConfigureServices(ServiceConfigurationContext context) { - services.AddAssemblyOf(); + context.Services.AddAssemblyOf(); } } } diff --git a/framework/test/Volo.Abp.AspNetCore.Mvc.Versioning.Tests/Volo/Abp/AspNetCore/Mvc/Versioning/AbpAspNetCoreMvcVersioningTestModule.cs b/framework/test/Volo.Abp.AspNetCore.Mvc.Versioning.Tests/Volo/Abp/AspNetCore/Mvc/Versioning/AbpAspNetCoreMvcVersioningTestModule.cs index b620de88c3..cb47f101a7 100644 --- a/framework/test/Volo.Abp.AspNetCore.Mvc.Versioning.Tests/Volo/Abp/AspNetCore/Mvc/Versioning/AbpAspNetCoreMvcVersioningTestModule.cs +++ b/framework/test/Volo.Abp.AspNetCore.Mvc.Versioning.Tests/Volo/Abp/AspNetCore/Mvc/Versioning/AbpAspNetCoreMvcVersioningTestModule.cs @@ -17,9 +17,9 @@ namespace Volo.Abp.AspNetCore.Mvc.Versioning )] public class AbpAspNetCoreMvcVersioningTestModule : AbpModule { - public override void ConfigureServices(IServiceCollection services) + public override void ConfigureServices(ServiceConfigurationContext context) { - services.Configure(options => + context.Services.Configure(options => { //2.0 Version options.ConventionalControllers.Create(typeof(AbpAspNetCoreMvcVersioningTestModule).Assembly, opts => @@ -36,7 +36,7 @@ namespace Volo.Abp.AspNetCore.Mvc.Versioning }); }); - services.AddApiVersioning(options => + context.Services.AddApiVersioning(options => { options.ReportApiVersions = true; options.AssumeDefaultVersionWhenUnspecified = true; @@ -44,14 +44,14 @@ namespace Volo.Abp.AspNetCore.Mvc.Versioning //options.ApiVersionReader = new HeaderApiVersionReader("api-version"); //Supports header too //options.ApiVersionReader = new MediaTypeApiVersionReader(); //Supports accept header too - options.ConfigureAbp(services); + options.ConfigureAbp(context.Services); }); - services.AddAssemblyOf(); + context.Services.AddAssemblyOf(); - services.AddHttpClientProxies(typeof(AbpAspNetCoreMvcVersioningTestModule).Assembly); + context.Services.AddHttpClientProxies(typeof(AbpAspNetCoreMvcVersioningTestModule).Assembly); - services.Configure(options => + context.Services.Configure(options => { options.RemoteServices.Default = new RemoteServiceConfiguration("/"); }); diff --git a/framework/test/Volo.Abp.Authorization.Tests/Volo/Abp/Authorization/AbpAuthorizationTestModule.cs b/framework/test/Volo.Abp.Authorization.Tests/Volo/Abp/Authorization/AbpAuthorizationTestModule.cs index 2a3ca8c5e9..5bbcb2ba81 100644 --- a/framework/test/Volo.Abp.Authorization.Tests/Volo/Abp/Authorization/AbpAuthorizationTestModule.cs +++ b/framework/test/Volo.Abp.Authorization.Tests/Volo/Abp/Authorization/AbpAuthorizationTestModule.cs @@ -10,25 +10,25 @@ namespace Volo.Abp.Authorization [DependsOn(typeof(AbpAuthorizationModule))] public class AbpAuthorizationTestModule : AbpModule { - public override void PreConfigureServices(IServiceCollection services) + public override void PreConfigureServices(ServiceConfigurationContext context) { - services.OnRegistred(context => + context.Services.OnRegistred(onServiceRegistredContext => { - if (typeof(IMyAuthorizedService1).IsAssignableFrom(context.ImplementationType)) + if (typeof(IMyAuthorizedService1).IsAssignableFrom(onServiceRegistredContext.ImplementationType)) { - context.Interceptors.TryAdd(); + onServiceRegistredContext.Interceptors.TryAdd(); } }); } - public override void ConfigureServices(IServiceCollection services) + public override void ConfigureServices(ServiceConfigurationContext context) { - services.Configure(options => + context.Services.Configure(options => { options.DefinitionProviders.TryAdd(); }); - services.AddAssemblyOf(); + context.Services.AddAssemblyOf(); } } } \ No newline at end of file diff --git a/framework/test/Volo.Abp.AutoMapper.Tests/Volo/Abp/AutoMapper/AutoMapper_ConfigurationValidation_Tests.cs b/framework/test/Volo.Abp.AutoMapper.Tests/Volo/Abp/AutoMapper/AutoMapper_ConfigurationValidation_Tests.cs index a75f5ff949..76861a5389 100644 --- a/framework/test/Volo.Abp.AutoMapper.Tests/Volo/Abp/AutoMapper/AutoMapper_ConfigurationValidation_Tests.cs +++ b/framework/test/Volo.Abp.AutoMapper.Tests/Volo/Abp/AutoMapper/AutoMapper_ConfigurationValidation_Tests.cs @@ -26,9 +26,9 @@ namespace Volo.Abp.AutoMapper [DependsOn(typeof(AbpAutoMapperModule))] public class TestModule : AbpModule { - public override void ConfigureServices(IServiceCollection services) + public override void ConfigureServices(ServiceConfigurationContext context) { - services.Configure(options => + context.Services.Configure(options => { options.UseStaticMapper = false; diff --git a/framework/test/Volo.Abp.AutoMapper.Tests/Volo/Abp/AutoMapper/AutofacTestModule.cs b/framework/test/Volo.Abp.AutoMapper.Tests/Volo/Abp/AutoMapper/AutofacTestModule.cs index 4dda1020e9..4c8fbf25ac 100644 --- a/framework/test/Volo.Abp.AutoMapper.Tests/Volo/Abp/AutoMapper/AutofacTestModule.cs +++ b/framework/test/Volo.Abp.AutoMapper.Tests/Volo/Abp/AutoMapper/AutofacTestModule.cs @@ -6,14 +6,14 @@ namespace Volo.Abp.AutoMapper [DependsOn(typeof(AbpAutoMapperModule))] public class AutoMapperTestModule : AbpModule { - public override void ConfigureServices(IServiceCollection services) + public override void ConfigureServices(ServiceConfigurationContext context) { - services.Configure(options => + context.Services.Configure(options => { options.UseStaticMapper = false; }); - services.AddAssemblyOf(); + context.Services.AddAssemblyOf(); } } } \ No newline at end of file diff --git a/framework/test/Volo.Abp.Autofac.Tests/Volo/Abp/Autofac/AutofacTestModule.cs b/framework/test/Volo.Abp.Autofac.Tests/Volo/Abp/Autofac/AutofacTestModule.cs index d6e73edf4f..a476048e70 100644 --- a/framework/test/Volo.Abp.Autofac.Tests/Volo/Abp/Autofac/AutofacTestModule.cs +++ b/framework/test/Volo.Abp.Autofac.Tests/Volo/Abp/Autofac/AutofacTestModule.cs @@ -6,9 +6,9 @@ namespace Volo.Abp.Autofac [DependsOn(typeof(AbpAutofacModule))] public class AutofacTestModule : AbpModule { - public override void ConfigureServices(IServiceCollection services) + public override void ConfigureServices(ServiceConfigurationContext context) { - services.AddAssemblyOf(); + context.Services.AddAssemblyOf(); } } } \ No newline at end of file diff --git a/framework/test/Volo.Abp.Caching.Tests/Volo/Abp/Caching/AbpCachingTestModule.cs b/framework/test/Volo.Abp.Caching.Tests/Volo/Abp/Caching/AbpCachingTestModule.cs index 410c1c58bf..03dc6e54bd 100644 --- a/framework/test/Volo.Abp.Caching.Tests/Volo/Abp/Caching/AbpCachingTestModule.cs +++ b/framework/test/Volo.Abp.Caching.Tests/Volo/Abp/Caching/AbpCachingTestModule.cs @@ -6,9 +6,9 @@ namespace Volo.Abp.Caching [DependsOn(typeof(AbpCachingModule))] public class AbpCachingTestModule : AbpModule { - public override void ConfigureServices(IServiceCollection services) + public override void ConfigureServices(ServiceConfigurationContext context) { - services.AddAssemblyOf(); + context.Services.AddAssemblyOf(); } } } \ No newline at end of file diff --git a/framework/test/Volo.Abp.Core.Tests/Microsoft/Extensions/DependencyInjection/DependencyInjection_Tests.cs b/framework/test/Volo.Abp.Core.Tests/Microsoft/Extensions/DependencyInjection/DependencyInjection_Tests.cs index 5d5ddc1b27..a3a3dc08f0 100644 --- a/framework/test/Volo.Abp.Core.Tests/Microsoft/Extensions/DependencyInjection/DependencyInjection_Tests.cs +++ b/framework/test/Volo.Abp.Core.Tests/Microsoft/Extensions/DependencyInjection/DependencyInjection_Tests.cs @@ -101,14 +101,14 @@ namespace Microsoft.Extensions.DependencyInjection public class TestModule : AbpModule { - public override void ConfigureServices(IServiceCollection services) + public override void ConfigureServices(ServiceConfigurationContext context) { - services.AddType(); - services.AddType(); - services.AddType(); - services.AddType(); - services.AddTransient(typeof(GenericServiceWithPropertyInject<>)); - services.AddTransient(typeof(ConcreteGenericServiceWithPropertyInject)); + context.Services.AddType(); + context.Services.AddType(); + context.Services.AddType(); + context.Services.AddType(); + context.Services.AddTransient(typeof(GenericServiceWithPropertyInject<>)); + context.Services.AddTransient(typeof(ConcreteGenericServiceWithPropertyInject)); } } diff --git a/framework/test/Volo.Abp.Core.Tests/Volo/Abp/Modularity/ModuleLoader_Tests.cs b/framework/test/Volo.Abp.Core.Tests/Volo/Abp/Modularity/ModuleLoader_Tests.cs index f9463189b1..c1b6c9f23d 100644 --- a/framework/test/Volo.Abp.Core.Tests/Volo/Abp/Modularity/ModuleLoader_Tests.cs +++ b/framework/test/Volo.Abp.Core.Tests/Volo/Abp/Modularity/ModuleLoader_Tests.cs @@ -20,7 +20,7 @@ namespace Volo.Abp.Modularity [DependsOn(typeof(IndependentEmptyModule))] public class MyStartupModule : IAbpModule { - public void ConfigureServices(IServiceCollection services) + public void ConfigureServices(ServiceConfigurationContext context) { } diff --git a/framework/test/Volo.Abp.Core.Tests/Volo/Abp/Modularity/TestModuleBase.cs b/framework/test/Volo.Abp.Core.Tests/Volo/Abp/Modularity/TestModuleBase.cs index fef7f85e09..fe1c1464b5 100644 --- a/framework/test/Volo.Abp.Core.Tests/Volo/Abp/Modularity/TestModuleBase.cs +++ b/framework/test/Volo.Abp.Core.Tests/Volo/Abp/Modularity/TestModuleBase.cs @@ -14,17 +14,17 @@ namespace Volo.Abp.Modularity public bool OnApplicationShutdownIsCalled { get; set; } - public override void PreConfigureServices(IServiceCollection services) + public override void PreConfigureServices(ServiceConfigurationContext context) { PreConfigureServicesIsCalled = true; } - public override void ConfigureServices(IServiceCollection services) + public override void ConfigureServices(ServiceConfigurationContext context) { ConfigureServicesIsCalled = true; } - public override void PostConfigureServices(IServiceCollection services) + public override void PostConfigureServices(ServiceConfigurationContext context) { PostConfigureServicesIsCalled = true; } diff --git a/framework/test/Volo.Abp.Data.Tests/Volo/Abp/Data/ConnectionStringResolver_Tests.cs b/framework/test/Volo.Abp.Data.Tests/Volo/Abp/Data/ConnectionStringResolver_Tests.cs index 9fd70f82e4..023e8d2e97 100644 --- a/framework/test/Volo.Abp.Data.Tests/Volo/Abp/Data/ConnectionStringResolver_Tests.cs +++ b/framework/test/Volo.Abp.Data.Tests/Volo/Abp/Data/ConnectionStringResolver_Tests.cs @@ -40,9 +40,9 @@ namespace Volo.Abp.Data [DependsOn(typeof(AbpDataModule))] public class TestModule : AbpModule { - public override void ConfigureServices(IServiceCollection services) + public override void ConfigureServices(ServiceConfigurationContext context) { - services.Configure(options => + context.Services.Configure(options => { options.ConnectionStrings.Default = DefaultConnString; options.ConnectionStrings[Database1Name] = Database1ConnString; diff --git a/framework/test/Volo.Abp.EntityFrameworkCore.Tests.SecondContext/Volo/Abp/EntityFrameworkCore/TestApp/SecondContext/AbpEfCoreTestSecondContextModule.cs b/framework/test/Volo.Abp.EntityFrameworkCore.Tests.SecondContext/Volo/Abp/EntityFrameworkCore/TestApp/SecondContext/AbpEfCoreTestSecondContextModule.cs index c72cc3cedf..089fe2a337 100644 --- a/framework/test/Volo.Abp.EntityFrameworkCore.Tests.SecondContext/Volo/Abp/EntityFrameworkCore/TestApp/SecondContext/AbpEfCoreTestSecondContextModule.cs +++ b/framework/test/Volo.Abp.EntityFrameworkCore.Tests.SecondContext/Volo/Abp/EntityFrameworkCore/TestApp/SecondContext/AbpEfCoreTestSecondContextModule.cs @@ -7,19 +7,19 @@ namespace Volo.Abp.EntityFrameworkCore.TestApp.SecondContext [DependsOn(typeof(AbpEntityFrameworkCoreModule))] public class AbpEfCoreTestSecondContextModule : AbpModule { - public override void ConfigureServices(IServiceCollection services) + public override void ConfigureServices(ServiceConfigurationContext context) { - services.AddAbpDbContext(options => + context.Services.AddAbpDbContext(options => { options.AddDefaultRepositories(); }); - services.AddAbpDbContext(options => + context.Services.AddAbpDbContext(options => { options.AddDefaultRepositories(); }); - services.AddAssemblyOf(); + context.Services.AddAssemblyOf(); } public override void OnApplicationInitialization(ApplicationInitializationContext context) diff --git a/framework/test/Volo.Abp.EntityFrameworkCore.Tests/Volo/Abp/EntityFrameworkCore/AbpEntityFrameworkCoreTestModule.cs b/framework/test/Volo.Abp.EntityFrameworkCore.Tests/Volo/Abp/EntityFrameworkCore/AbpEntityFrameworkCoreTestModule.cs index b46f5983cd..6102fe12ae 100644 --- a/framework/test/Volo.Abp.EntityFrameworkCore.Tests/Volo/Abp/EntityFrameworkCore/AbpEntityFrameworkCoreTestModule.cs +++ b/framework/test/Volo.Abp.EntityFrameworkCore.Tests/Volo/Abp/EntityFrameworkCore/AbpEntityFrameworkCoreTestModule.cs @@ -19,11 +19,11 @@ namespace Volo.Abp.EntityFrameworkCore [DependsOn(typeof(AbpEfCoreTestSecondContextModule))] public class AbpEntityFrameworkCoreTestModule : AbpModule { - public override void ConfigureServices(IServiceCollection services) + public override void ConfigureServices(ServiceConfigurationContext context) { - services.AddAssemblyOf(); + context.Services.AddAssemblyOf(); - services.AddAbpDbContext(options => + context.Services.AddAbpDbContext(options => { options.AddDefaultRepositories(true); options.ReplaceDbContext(); @@ -36,11 +36,11 @@ namespace Volo.Abp.EntityFrameworkCore var sqliteConnection = CreateDatabaseAndGetConnection(); - services.Configure(options => + context.Services.Configure(options => { - options.Configure(context => + options.Configure(abpDbContextConfigurationContext => { - context.DbContextOptions.UseSqlite(sqliteConnection); + abpDbContextConfigurationContext.DbContextOptions.UseSqlite(sqliteConnection); }); }); } diff --git a/framework/test/Volo.Abp.EventBus.Tests/Volo/Abp/EventBus/EventBusTestModule.cs b/framework/test/Volo.Abp.EventBus.Tests/Volo/Abp/EventBus/EventBusTestModule.cs index 63f644cb66..e7f8b40ddd 100644 --- a/framework/test/Volo.Abp.EventBus.Tests/Volo/Abp/EventBus/EventBusTestModule.cs +++ b/framework/test/Volo.Abp.EventBus.Tests/Volo/Abp/EventBus/EventBusTestModule.cs @@ -6,9 +6,9 @@ namespace Volo.Abp.EventBus [DependsOn(typeof(AbpEventBusModule))] public class EventBusTestModule : AbpModule { - public override void ConfigureServices(IServiceCollection services) + public override void ConfigureServices(ServiceConfigurationContext context) { - services.AddAssemblyOf(); + context.Services.AddAssemblyOf(); } } } \ No newline at end of file diff --git a/framework/test/Volo.Abp.Http.Client.Tests/Volo/Abp/Http/AbpHttpTestModule.cs b/framework/test/Volo.Abp.Http.Client.Tests/Volo/Abp/Http/AbpHttpTestModule.cs index abe8065b75..f0313110c9 100644 --- a/framework/test/Volo.Abp.Http.Client.Tests/Volo/Abp/Http/AbpHttpTestModule.cs +++ b/framework/test/Volo.Abp.Http.Client.Tests/Volo/Abp/Http/AbpHttpTestModule.cs @@ -10,14 +10,14 @@ namespace Volo.Abp.Http [DependsOn(typeof(AbpAspNetCoreMvcTestModule), typeof(AbpHttpClientModule))] public class AbpHttpTestModule : AbpModule { - public override void ConfigureServices(IServiceCollection services) + public override void ConfigureServices(ServiceConfigurationContext context) { - services.AddAssemblyOf(); + context.Services.AddAssemblyOf(); - services.AddHttpClientProxies(typeof(TestAppModule).Assembly); - services.AddHttpClientProxy(); + context.Services.AddHttpClientProxies(typeof(TestAppModule).Assembly); + context.Services.AddHttpClientProxy(); - services.Configure(options => + context.Services.Configure(options => { options.RemoteServices.Default = new RemoteServiceConfiguration("/"); }); diff --git a/framework/test/Volo.Abp.Localization.Tests/Volo/Abp/Localization/AbpLocalization_Tests.cs b/framework/test/Volo.Abp.Localization.Tests/Volo/Abp/Localization/AbpLocalization_Tests.cs index 06cc5c2324..70f3531754 100644 --- a/framework/test/Volo.Abp.Localization.Tests/Volo/Abp/Localization/AbpLocalization_Tests.cs +++ b/framework/test/Volo.Abp.Localization.Tests/Volo/Abp/Localization/AbpLocalization_Tests.cs @@ -108,14 +108,14 @@ namespace Volo.Abp.Localization [DependsOn(typeof(AbpLocalizationModule))] public class TestModule : AbpModule { - public override void ConfigureServices(IServiceCollection services) + public override void ConfigureServices(ServiceConfigurationContext context) { - services.Configure(options => + context.Services.Configure(options => { options.FileSets.AddEmbedded(); }); - services.Configure(options => + context.Services.Configure(options => { options.Resources.Add("en").AddVirtualJson("/Volo/Abp/Localization/TestResources/Base/Validation"); options.Resources.Add("en").AddVirtualJson("/Volo/Abp/Localization/TestResources/Base/CountryNames"); diff --git a/framework/test/Volo.Abp.MemoryDb.Tests/Volo/Abp/MemoryDb/AbpMemoryDbTestModule.cs b/framework/test/Volo.Abp.MemoryDb.Tests/Volo/Abp/MemoryDb/AbpMemoryDbTestModule.cs index 980cf1eecb..2bc87b0ed3 100644 --- a/framework/test/Volo.Abp.MemoryDb.Tests/Volo/Abp/MemoryDb/AbpMemoryDbTestModule.cs +++ b/framework/test/Volo.Abp.MemoryDb.Tests/Volo/Abp/MemoryDb/AbpMemoryDbTestModule.cs @@ -15,22 +15,22 @@ namespace Volo.Abp.MemoryDb typeof(AbpAutofacModule))] public class AbpMemoryDbTestModule : AbpModule { - public override void ConfigureServices(IServiceCollection services) + public override void ConfigureServices(ServiceConfigurationContext context) { var connStr = Guid.NewGuid().ToString(); - services.Configure(options => + context.Services.Configure(options => { options.ConnectionStrings.Default = connStr; }); - services.AddMemoryDbContext(options => + context.Services.AddMemoryDbContext(options => { options.AddDefaultRepositories(); options.AddRepository(); }); - services.AddAssemblyOf(); + context.Services.AddAssemblyOf(); } } } diff --git a/framework/test/Volo.Abp.MongoDB.Tests/Volo/Abp/MongoDB/AbpMongoDbTestModule.cs b/framework/test/Volo.Abp.MongoDB.Tests/Volo/Abp/MongoDB/AbpMongoDbTestModule.cs index 7f8425a9df..3dba5cdd8a 100644 --- a/framework/test/Volo.Abp.MongoDB.Tests/Volo/Abp/MongoDB/AbpMongoDbTestModule.cs +++ b/framework/test/Volo.Abp.MongoDB.Tests/Volo/Abp/MongoDB/AbpMongoDbTestModule.cs @@ -16,22 +16,22 @@ namespace Volo.Abp.MongoDB { private MongoDbRunner _mongoDbRunner; - public override void ConfigureServices(IServiceCollection services) + public override void ConfigureServices(ServiceConfigurationContext context) { _mongoDbRunner = MongoDbRunner.Start(); - services.Configure(options => + context.Services.Configure(options => { options.ConnectionStrings.Default = _mongoDbRunner.ConnectionString; }); - services.AddMongoDbContext(options => + context.Services.AddMongoDbContext(options => { options.AddDefaultRepositories(); options.AddRepository(); }); - services.AddAssemblyOf(); + context.Services.AddAssemblyOf(); } public override void OnApplicationShutdown(ApplicationShutdownContext context) diff --git a/framework/test/Volo.Abp.Serialization.Tests/Volo/Abp/Serialization/AbpSerializationTestModule.cs b/framework/test/Volo.Abp.Serialization.Tests/Volo/Abp/Serialization/AbpSerializationTestModule.cs index 1204bc3f2f..cd5b6fc3e0 100644 --- a/framework/test/Volo.Abp.Serialization.Tests/Volo/Abp/Serialization/AbpSerializationTestModule.cs +++ b/framework/test/Volo.Abp.Serialization.Tests/Volo/Abp/Serialization/AbpSerializationTestModule.cs @@ -6,9 +6,9 @@ namespace Volo.Abp.Serialization [DependsOn(typeof(AbpSerializationModule))] public class AbpSerializationTestModule : AbpModule { - public override void ConfigureServices(IServiceCollection services) + public override void ConfigureServices(ServiceConfigurationContext context) { - services.AddAssemblyOf(); + context.Services.AddAssemblyOf(); } } } \ No newline at end of file diff --git a/framework/test/Volo.Abp.TestApp.Tests/Volo/Abp/TestApp/TestAppTestModule.cs b/framework/test/Volo.Abp.TestApp.Tests/Volo/Abp/TestApp/TestAppTestModule.cs index b7e16ad4b1..1c27fcd426 100644 --- a/framework/test/Volo.Abp.TestApp.Tests/Volo/Abp/TestApp/TestAppTestModule.cs +++ b/framework/test/Volo.Abp.TestApp.Tests/Volo/Abp/TestApp/TestAppTestModule.cs @@ -7,9 +7,9 @@ namespace Volo.Abp.TestApp [DependsOn(typeof(AbpMemoryDbTestModule))] public class TestAppTestModule : AbpModule { - public override void ConfigureServices(IServiceCollection services) + public override void ConfigureServices(ServiceConfigurationContext context) { - services.AddAssemblyOf(); + context.Services.AddAssemblyOf(); } } } diff --git a/framework/test/Volo.Abp.TestApp/Volo/Abp/TestApp/TestAppModule.cs b/framework/test/Volo.Abp.TestApp/Volo/Abp/TestApp/TestAppModule.cs index 2720696492..1f26a29231 100644 --- a/framework/test/Volo.Abp.TestApp/Volo/Abp/TestApp/TestAppModule.cs +++ b/framework/test/Volo.Abp.TestApp/Volo/Abp/TestApp/TestAppModule.cs @@ -16,11 +16,11 @@ namespace Volo.Abp.TestApp )] public class TestAppModule : AbpModule { - public override void ConfigureServices(IServiceCollection services) + public override void ConfigureServices(ServiceConfigurationContext context) { - ConfigureAutoMapper(services); + ConfigureAutoMapper(context.Services); - services.AddAssemblyOf(); + context.Services.AddAssemblyOf(); } public override void OnApplicationInitialization(ApplicationInitializationContext context) diff --git a/framework/test/Volo.Abp.UI.Navigation.Tests/Volo/Abp/Ui/Navigation/MenuManager_Tests.cs b/framework/test/Volo.Abp.UI.Navigation.Tests/Volo/Abp/Ui/Navigation/MenuManager_Tests.cs index 59682c9ac3..ee54e18413 100644 --- a/framework/test/Volo.Abp.UI.Navigation.Tests/Volo/Abp/Ui/Navigation/MenuManager_Tests.cs +++ b/framework/test/Volo.Abp.UI.Navigation.Tests/Volo/Abp/Ui/Navigation/MenuManager_Tests.cs @@ -34,9 +34,9 @@ namespace Volo.Abp.UI.Navigation [DependsOn(typeof(AbpUiNavigationModule))] public class TestModule : AbpModule { - public override void ConfigureServices(IServiceCollection services) + public override void ConfigureServices(ServiceConfigurationContext context) { - services.Configure(options => + context.Services.Configure(options => { options.MenuContributors.Add(new TestMenuContributer1()); options.MenuContributors.Add(new TestMenuContributer2()); diff --git a/framework/test/Volo.Abp.Validation.Tests/Volo/Abp/Validation/ApplicationService_Validation_Tests.cs b/framework/test/Volo.Abp.Validation.Tests/Volo/Abp/Validation/ApplicationService_Validation_Tests.cs index 494c699761..c58c244842 100644 --- a/framework/test/Volo.Abp.Validation.Tests/Volo/Abp/Validation/ApplicationService_Validation_Tests.cs +++ b/framework/test/Volo.Abp.Validation.Tests/Volo/Abp/Validation/ApplicationService_Validation_Tests.cs @@ -149,20 +149,20 @@ namespace Volo.Abp.Validation [DependsOn(typeof(AbpValidationModule))] public class TestModule : AbpModule { - public override void PreConfigureServices(IServiceCollection services) + public override void PreConfigureServices(ServiceConfigurationContext context) { - services.OnRegistred(context => + context.Services.OnRegistred(onServiceRegistredContext => { - if (typeof(IMyAppService).IsAssignableFrom(context.ImplementationType)) + if (typeof(IMyAppService).IsAssignableFrom(onServiceRegistredContext.ImplementationType)) { - context.Interceptors.TryAdd(); + onServiceRegistredContext.Interceptors.TryAdd(); } }); } - public override void ConfigureServices(IServiceCollection services) + public override void ConfigureServices(ServiceConfigurationContext context) { - services.AddType(); + context.Services.AddType(); } } diff --git a/framework/test/Volo.Abp.VirtualFileSystem.Tests/Volo/Abp/VirtualFileSystem/DynamicFileProvider_Tests.cs b/framework/test/Volo.Abp.VirtualFileSystem.Tests/Volo/Abp/VirtualFileSystem/DynamicFileProvider_Tests.cs index 4fd4c03d46..e3ff516949 100644 --- a/framework/test/Volo.Abp.VirtualFileSystem.Tests/Volo/Abp/VirtualFileSystem/DynamicFileProvider_Tests.cs +++ b/framework/test/Volo.Abp.VirtualFileSystem.Tests/Volo/Abp/VirtualFileSystem/DynamicFileProvider_Tests.cs @@ -86,7 +86,7 @@ namespace Volo.Abp.VirtualFileSystem [DependsOn(typeof(AbpVirtualFileSystemModule))] public class TestModule : AbpModule { - public override void ConfigureServices(IServiceCollection services) + public override void ConfigureServices(ServiceConfigurationContext context) { } diff --git a/framework/test/Volo.Abp.VirtualFileSystem.Tests/Volo/Abp/VirtualFileSystem/VirtualFileProvider_Tests.cs b/framework/test/Volo.Abp.VirtualFileSystem.Tests/Volo/Abp/VirtualFileSystem/VirtualFileProvider_Tests.cs index b557c96a52..de05114301 100644 --- a/framework/test/Volo.Abp.VirtualFileSystem.Tests/Volo/Abp/VirtualFileSystem/VirtualFileProvider_Tests.cs +++ b/framework/test/Volo.Abp.VirtualFileSystem.Tests/Volo/Abp/VirtualFileSystem/VirtualFileProvider_Tests.cs @@ -35,9 +35,9 @@ namespace Volo.Abp.VirtualFileSystem [DependsOn(typeof(AbpVirtualFileSystemModule))] public class TestModule : AbpModule { - public override void ConfigureServices(IServiceCollection services) + public override void ConfigureServices(ServiceConfigurationContext context) { - services.Configure(options => + context.Services.Configure(options => { options.FileSets.AddEmbedded("Volo.Abp.VirtualFileSystem.MyResources"); }); diff --git a/modules/account/src/Volo.Abp.Account.Web/AbpAccountWebModule.cs b/modules/account/src/Volo.Abp.Account.Web/AbpAccountWebModule.cs index 3e60710401..9bafe1618c 100644 --- a/modules/account/src/Volo.Abp.Account.Web/AbpAccountWebModule.cs +++ b/modules/account/src/Volo.Abp.Account.Web/AbpAccountWebModule.cs @@ -19,32 +19,32 @@ namespace Volo.Abp.Account.Web [DependsOn(typeof(AbpAspNetCoreMvcUiThemeSharedModule))] public class AbpAccountWebModule : AbpModule { - public override void PreConfigureServices(IServiceCollection services) + public override void PreConfigureServices(ServiceConfigurationContext context) { - services.PreConfigure(options => + context.Services.PreConfigure(options => { options.AddAssemblyResource(typeof(AccountResource), typeof(AbpAccountWebModule).Assembly); }); } - public override void ConfigureServices(IServiceCollection services) + public override void ConfigureServices(ServiceConfigurationContext context) { - services.Configure(options => + context.Services.Configure(options => { options.DefinitionProviders.Add(); }); - services.Configure(options => + context.Services.Configure(options => { options.FileSets.AddEmbedded("Volo.Abp.Account.Web"); }); - services.Configure(options => + context.Services.Configure(options => { options.MenuContributors.Add(new AbpAccountUserMenuContributor()); }); - services.Configure(options => + context.Services.Configure(options => { options.Resources .Add("en") @@ -52,12 +52,12 @@ namespace Volo.Abp.Account.Web .AddBaseTypes(typeof(AbpUiResource), typeof(AbpValidationResource)); }); - services.Configure(options => + context.Services.Configure(options => { options.Contributors.Add(new AccountModuleToolbarContributor()); }); - services.AddAssemblyOf(); + context.Services.AddAssemblyOf(); } } } diff --git a/modules/blogging/app/Volo.BloggingTestApp.EntityFrameworkCore/BloggingTestAppEntityFrameworkCoreModule.cs b/modules/blogging/app/Volo.BloggingTestApp.EntityFrameworkCore/BloggingTestAppEntityFrameworkCoreModule.cs index 6e21c1b972..b1102c6d83 100644 --- a/modules/blogging/app/Volo.BloggingTestApp.EntityFrameworkCore/BloggingTestAppEntityFrameworkCoreModule.cs +++ b/modules/blogging/app/Volo.BloggingTestApp.EntityFrameworkCore/BloggingTestAppEntityFrameworkCoreModule.cs @@ -16,9 +16,9 @@ namespace Volo.BloggingTestApp.EntityFrameworkCore typeof(AbpEntityFrameworkCoreSqlServerModule))] public class BloggingTestAppEntityFrameworkCoreModule : AbpModule { - public override void ConfigureServices(IServiceCollection services) + public override void ConfigureServices(ServiceConfigurationContext context) { - services.AddAssemblyOf(); + context.Services.AddAssemblyOf(); } } } diff --git a/modules/blogging/app/Volo.BloggingTestApp/BloggingTestAppModule.cs b/modules/blogging/app/Volo.BloggingTestApp/BloggingTestAppModule.cs index a43ab5be91..1f86ea6e32 100644 --- a/modules/blogging/app/Volo.BloggingTestApp/BloggingTestAppModule.cs +++ b/modules/blogging/app/Volo.BloggingTestApp/BloggingTestAppModule.cs @@ -43,25 +43,25 @@ namespace Volo.BloggingTestApp )] public class BloggingTestAppModule : AbpModule { - public override void ConfigureServices(IServiceCollection services) + public override void ConfigureServices(ServiceConfigurationContext context) { - var hostingEnvironment = services.GetHostingEnvironment(); - var configuration = services.BuildConfiguration(); + var hostingEnvironment = context.Services.GetHostingEnvironment(); + var configuration = context.Services.BuildConfiguration(); - services.Configure(options => + context.Services.Configure(options => { const string connStringName = "SqlServer"; options.ConnectionStrings.Default = configuration.GetConnectionString(connStringName); }); - services.Configure(options => + context.Services.Configure(options => { options.UseSqlServer(); }); if (hostingEnvironment.IsDevelopment()) { - services.Configure(options => + context.Services.Configure(options => { options.FileSets.ReplaceEmbeddedByPyhsical(Path.Combine(hostingEnvironment.ContentRootPath, "..\\..\\..\\..\\framework\\src\\Volo.Abp.UI")); options.FileSets.ReplaceEmbeddedByPyhsical(Path.Combine(hostingEnvironment.ContentRootPath, "..\\..\\..\\..\\framework\\src\\Volo.Abp.AspNetCore.Mvc.UI")); @@ -73,7 +73,7 @@ namespace Volo.BloggingTestApp }); } - services.AddSwaggerGen( + context.Services.AddSwaggerGen( options => { options.SwaggerDoc("v1", new Info { Title = "Blogging API", Version = "v1" }); @@ -81,19 +81,19 @@ namespace Volo.BloggingTestApp }); var cultures = new List { new CultureInfo("en"), new CultureInfo("tr") }; - services.Configure(options => + context.Services.Configure(options => { options.DefaultRequestCulture = new RequestCulture("en"); options.SupportedCultures = cultures; options.SupportedUICultures = cultures; }); - services.Configure(options => + context.Services.Configure(options => { options.DefaultThemeName = BasicTheme.Name; }); - services.AddAssemblyOf(); + context.Services.AddAssemblyOf(); } public override void OnApplicationInitialization(ApplicationInitializationContext context) diff --git a/modules/blogging/src/Volo.Blogging.Application.Contracts/Volo/Blogging/BloggingApplicationContractsModule.cs b/modules/blogging/src/Volo.Blogging.Application.Contracts/Volo/Blogging/BloggingApplicationContractsModule.cs index f246b051d1..b9c139fae0 100644 --- a/modules/blogging/src/Volo.Blogging.Application.Contracts/Volo/Blogging/BloggingApplicationContractsModule.cs +++ b/modules/blogging/src/Volo.Blogging.Application.Contracts/Volo/Blogging/BloggingApplicationContractsModule.cs @@ -7,14 +7,14 @@ namespace Volo.Blogging [DependsOn(typeof(BloggingDomainSharedModule))] public class BloggingApplicationContractsModule : AbpModule { - public override void ConfigureServices(IServiceCollection services) + public override void ConfigureServices(ServiceConfigurationContext context) { - services.Configure(options => + context.Services.Configure(options => { options.DefinitionProviders.Add(); }); - services.AddAssemblyOf(); + context.Services.AddAssemblyOf(); } } } diff --git a/modules/blogging/src/Volo.Blogging.Application/Volo/Blogging/BloggingApplicationModule.cs b/modules/blogging/src/Volo.Blogging.Application/Volo/Blogging/BloggingApplicationModule.cs index a033eac84b..c075434b10 100644 --- a/modules/blogging/src/Volo.Blogging.Application/Volo/Blogging/BloggingApplicationModule.cs +++ b/modules/blogging/src/Volo.Blogging.Application/Volo/Blogging/BloggingApplicationModule.cs @@ -12,14 +12,14 @@ namespace Volo.Blogging typeof(AbpAutoMapperModule))] public class BloggingApplicationModule : AbpModule { - public override void ConfigureServices(IServiceCollection services) + public override void ConfigureServices(ServiceConfigurationContext context) { - services.Configure(options => + context.Services.Configure(options => { options.AddProfile(validate: true); }); - services.AddAssemblyOf(); + context.Services.AddAssemblyOf(); } } } diff --git a/modules/blogging/src/Volo.Blogging.Domain.Shared/Volo/Blogging/BloggingDomainSharedModule.cs b/modules/blogging/src/Volo.Blogging.Domain.Shared/Volo/Blogging/BloggingDomainSharedModule.cs index 8a0a8227da..9f066a448d 100644 --- a/modules/blogging/src/Volo.Blogging.Domain.Shared/Volo/Blogging/BloggingDomainSharedModule.cs +++ b/modules/blogging/src/Volo.Blogging.Domain.Shared/Volo/Blogging/BloggingDomainSharedModule.cs @@ -8,14 +8,14 @@ namespace Volo.Blogging [DependsOn(typeof(AbpLocalizationModule))] public class BloggingDomainSharedModule : AbpModule { - public override void ConfigureServices(IServiceCollection services) + public override void ConfigureServices(ServiceConfigurationContext context) { - services.Configure(options => + context.Services.Configure(options => { options.Resources.Add("en"); }); - services.AddAssemblyOf(); + context.Services.AddAssemblyOf(); } } } diff --git a/modules/blogging/src/Volo.Blogging.Domain/Volo/Blogging/BloggingDomainModule.cs b/modules/blogging/src/Volo.Blogging.Domain/Volo/Blogging/BloggingDomainModule.cs index d97d869924..11d5419f27 100644 --- a/modules/blogging/src/Volo.Blogging.Domain/Volo/Blogging/BloggingDomainModule.cs +++ b/modules/blogging/src/Volo.Blogging.Domain/Volo/Blogging/BloggingDomainModule.cs @@ -9,9 +9,9 @@ namespace Volo.Blogging typeof(AbpDddDomainModule))] public class BloggingDomainModule : AbpModule { - public override void ConfigureServices(IServiceCollection services) + public override void ConfigureServices(ServiceConfigurationContext context) { - services.AddAssemblyOf(); + context.Services.AddAssemblyOf(); } } } diff --git a/modules/blogging/src/Volo.Blogging.EntityFrameworkCore/Volo/Blogging/EntityFrameworkCore/BloggingEntityFrameworkCoreModule.cs b/modules/blogging/src/Volo.Blogging.EntityFrameworkCore/Volo/Blogging/EntityFrameworkCore/BloggingEntityFrameworkCoreModule.cs index e48806b815..c7b53a1a75 100644 --- a/modules/blogging/src/Volo.Blogging.EntityFrameworkCore/Volo/Blogging/EntityFrameworkCore/BloggingEntityFrameworkCoreModule.cs +++ b/modules/blogging/src/Volo.Blogging.EntityFrameworkCore/Volo/Blogging/EntityFrameworkCore/BloggingEntityFrameworkCoreModule.cs @@ -9,11 +9,11 @@ namespace Volo.Blogging.EntityFrameworkCore typeof(AbpEntityFrameworkCoreModule))] public class BloggingEntityFrameworkCoreModule : AbpModule { - public override void ConfigureServices(IServiceCollection services) + public override void ConfigureServices(ServiceConfigurationContext context) { - services.AddAbpDbContext(); + context.Services.AddAbpDbContext(); - services.AddAssemblyOf(); + context.Services.AddAssemblyOf(); } } } diff --git a/modules/blogging/src/Volo.Blogging.HttpApi.Client/Volo/Blogging/BloggingHttpApiClientModule.cs b/modules/blogging/src/Volo.Blogging.HttpApi.Client/Volo/Blogging/BloggingHttpApiClientModule.cs index e57084e31f..dcbc9d8df6 100644 --- a/modules/blogging/src/Volo.Blogging.HttpApi.Client/Volo/Blogging/BloggingHttpApiClientModule.cs +++ b/modules/blogging/src/Volo.Blogging.HttpApi.Client/Volo/Blogging/BloggingHttpApiClientModule.cs @@ -7,9 +7,9 @@ namespace Volo.Blogging typeof(BloggingApplicationContractsModule))] public class BloggingHttpApiClientModule : AbpModule { - public override void ConfigureServices(IServiceCollection services) + public override void ConfigureServices(ServiceConfigurationContext context) { - services.AddAssemblyOf(); + context.Services.AddAssemblyOf(); } } } diff --git a/modules/blogging/src/Volo.Blogging.HttpApi/Volo/Blogging/BloggingHttpApiModule.cs b/modules/blogging/src/Volo.Blogging.HttpApi/Volo/Blogging/BloggingHttpApiModule.cs index d171026e6c..e2a58d2940 100644 --- a/modules/blogging/src/Volo.Blogging.HttpApi/Volo/Blogging/BloggingHttpApiModule.cs +++ b/modules/blogging/src/Volo.Blogging.HttpApi/Volo/Blogging/BloggingHttpApiModule.cs @@ -7,9 +7,9 @@ namespace Volo.Blogging typeof(BloggingApplicationContractsModule))] public class BloggingHttpApiModule : AbpModule { - public override void ConfigureServices(IServiceCollection services) + public override void ConfigureServices(ServiceConfigurationContext context) { - services.AddAssemblyOf(); + context.Services.AddAssemblyOf(); } } } diff --git a/modules/blogging/src/Volo.Blogging.Web/BloggingWebModule.cs b/modules/blogging/src/Volo.Blogging.Web/BloggingWebModule.cs index 186f3a44fa..cf2195b4fc 100644 --- a/modules/blogging/src/Volo.Blogging.Web/BloggingWebModule.cs +++ b/modules/blogging/src/Volo.Blogging.Web/BloggingWebModule.cs @@ -20,22 +20,22 @@ namespace Volo.Blogging )] public class BloggingWebModule : AbpModule { - public override void PreConfigureServices(IServiceCollection services) + public override void PreConfigureServices(ServiceConfigurationContext context) { - services.PreConfigure(options => + context.Services.PreConfigure(options => { options.AddAssemblyResource(typeof(BloggingResource), typeof(BloggingWebModule).Assembly); }); } - public override void ConfigureServices(IServiceCollection services) + public override void ConfigureServices(ServiceConfigurationContext context) { - services.Configure(options => + context.Services.Configure(options => { options.FileSets.AddEmbedded("Volo.Blogging"); }); - services.Configure(options => + context.Services.Configure(options => { options.Resources .Get() @@ -44,12 +44,12 @@ namespace Volo.Blogging .AddVirtualJson("/Localization/Resources/Blogging/Web"); }); - services.Configure(options => + context.Services.Configure(options => { options.AddProfile(validate: true); }); - services.Configure(options => + context.Services.Configure(options => { //TODO: Make configurable! options.Conventions.AddPageRoute("/Blog/Posts/Index", "blog/{blogShortName}"); @@ -58,7 +58,7 @@ namespace Volo.Blogging options.Conventions.AddPageRoute("/Blog/Posts/New", "blog/{blogShortName}/posts/new"); }); - services.AddAssemblyOf(); + context.Services.AddAssemblyOf(); } } } diff --git a/modules/blogging/test/Volo.Blogging.Application.Tests/Volo/Blogging/BloggingApplicationTestModule.cs b/modules/blogging/test/Volo.Blogging.Application.Tests/Volo/Blogging/BloggingApplicationTestModule.cs index ccb7bbfa99..61acc2e378 100644 --- a/modules/blogging/test/Volo.Blogging.Application.Tests/Volo/Blogging/BloggingApplicationTestModule.cs +++ b/modules/blogging/test/Volo.Blogging.Application.Tests/Volo/Blogging/BloggingApplicationTestModule.cs @@ -10,11 +10,11 @@ namespace Volo.Blogging typeof(BloggingTestBaseModule))] public class BloggingApplicationTestModule : AbpModule { - public override void ConfigureServices(IServiceCollection services) + public override void ConfigureServices(ServiceConfigurationContext context) { - services.AddAlwaysAllowAuthorization(); + context.Services.AddAlwaysAllowAuthorization(); - services.AddAssemblyOf(); + context.Services.AddAssemblyOf(); } } } diff --git a/modules/blogging/test/Volo.Blogging.EntityFrameworkCore.Tests/Volo/Blogging/EntityFrameworkCore/BloggingEntityFrameworkCoreTestModule.cs b/modules/blogging/test/Volo.Blogging.EntityFrameworkCore.Tests/Volo/Blogging/EntityFrameworkCore/BloggingEntityFrameworkCoreTestModule.cs index 3b612d8564..68bf574580 100644 --- a/modules/blogging/test/Volo.Blogging.EntityFrameworkCore.Tests/Volo/Blogging/EntityFrameworkCore/BloggingEntityFrameworkCoreTestModule.cs +++ b/modules/blogging/test/Volo.Blogging.EntityFrameworkCore.Tests/Volo/Blogging/EntityFrameworkCore/BloggingEntityFrameworkCoreTestModule.cs @@ -17,19 +17,19 @@ namespace Volo.Blogging.EntityFrameworkCore { private SqliteConnection _sqliteConnection; - public override void ConfigureServices(IServiceCollection services) + public override void ConfigureServices(ServiceConfigurationContext context) { _sqliteConnection = CreateDatabaseAndGetConnection(); - services.Configure(options => + context.Services.Configure(options => { - options.Configure(context => + options.Configure(abpDbContextConfigurationContext => { - context.DbContextOptions.UseSqlite(_sqliteConnection); + abpDbContextConfigurationContext.DbContextOptions.UseSqlite(_sqliteConnection); }); }); - services.AddAssemblyOf(); + context.Services.AddAssemblyOf(); } private static SqliteConnection CreateDatabaseAndGetConnection() diff --git a/modules/blogging/test/Volo.Blogging.TestBase/Volo/Blogging/BloggingTestBaseModule.cs b/modules/blogging/test/Volo.Blogging.TestBase/Volo/Blogging/BloggingTestBaseModule.cs index 2e285e51a9..28539f255d 100644 --- a/modules/blogging/test/Volo.Blogging.TestBase/Volo/Blogging/BloggingTestBaseModule.cs +++ b/modules/blogging/test/Volo.Blogging.TestBase/Volo/Blogging/BloggingTestBaseModule.cs @@ -12,9 +12,9 @@ namespace Volo.Blogging )] public class BloggingTestBaseModule : AbpModule { - public override void ConfigureServices(IServiceCollection services) + public override void ConfigureServices(ServiceConfigurationContext context) { - services.AddAssemblyOf(); + context.Services.AddAssemblyOf(); } public override void OnApplicationInitialization(ApplicationInitializationContext context) diff --git a/modules/docs/app/Volo.DocsTestApp.EntityFrameworkCore/DocsTestAppEntityFrameworkCoreModule.cs b/modules/docs/app/Volo.DocsTestApp.EntityFrameworkCore/DocsTestAppEntityFrameworkCoreModule.cs index 9c6f9b4bf1..54bb4c250b 100644 --- a/modules/docs/app/Volo.DocsTestApp.EntityFrameworkCore/DocsTestAppEntityFrameworkCoreModule.cs +++ b/modules/docs/app/Volo.DocsTestApp.EntityFrameworkCore/DocsTestAppEntityFrameworkCoreModule.cs @@ -10,9 +10,9 @@ namespace Volo.DocsTestApp.EntityFrameworkCore typeof(AbpEntityFrameworkCoreSqlServerModule))] public class DocsTestAppEntityFrameworkCoreModule : AbpModule { - public override void ConfigureServices(IServiceCollection services) + public override void ConfigureServices(ServiceConfigurationContext context) { - services.AddAssemblyOf(); + context.Services.AddAssemblyOf(); } } } diff --git a/modules/docs/app/Volo.DocsTestApp/DocsTestAppModule.cs b/modules/docs/app/Volo.DocsTestApp/DocsTestAppModule.cs index 3758263974..4ab4bdee4a 100644 --- a/modules/docs/app/Volo.DocsTestApp/DocsTestAppModule.cs +++ b/modules/docs/app/Volo.DocsTestApp/DocsTestAppModule.cs @@ -35,25 +35,25 @@ namespace Volo.DocsTestApp )] public class DocsTestAppModule : AbpModule { - public override void ConfigureServices(IServiceCollection services) + public override void ConfigureServices(ServiceConfigurationContext context) { - var hostingEnvironment = services.GetHostingEnvironment(); - var configuration = services.GetConfiguration(); + var hostingEnvironment = context.Services.GetHostingEnvironment(); + var configuration = context.Services.GetConfiguration(); - services.Configure(options => + context.Services.Configure(options => { const string connStringName = "SqlServer"; options.ConnectionStrings.Default = configuration.GetConnectionString(connStringName); }); - services.Configure(options => + context.Services.Configure(options => { options.UseSqlServer(); }); if (hostingEnvironment.IsDevelopment()) { - services.Configure(options => + context.Services.Configure(options => { options.FileSets.ReplaceEmbeddedByPyhsical(Path.Combine(hostingEnvironment.ContentRootPath, "..\\..\\..\\..\\framework\\src\\Volo.Abp.UI")); options.FileSets.ReplaceEmbeddedByPyhsical(Path.Combine(hostingEnvironment.ContentRootPath, "..\\..\\..\\..\\framework\\src\\Volo.Abp.AspNetCore.Mvc.UI")); @@ -65,7 +65,7 @@ namespace Volo.DocsTestApp }); } - services.AddSwaggerGen( + context.Services.AddSwaggerGen( options => { options.SwaggerDoc("v1", new Info { Title = "Docs API", Version = "v1" }); @@ -74,19 +74,19 @@ namespace Volo.DocsTestApp var cultures = new List { new CultureInfo("en"), new CultureInfo("tr") }; - services.Configure(options => + context.Services.Configure(options => { options.DefaultRequestCulture = new RequestCulture("en"); options.SupportedCultures = cultures; options.SupportedUICultures = cultures; }); - services.Configure(options => + context.Services.Configure(options => { options.DefaultThemeName = BasicTheme.Name; }); - services.AddAssemblyOf(); + context.Services.AddAssemblyOf(); } public override void OnApplicationInitialization(ApplicationInitializationContext context) diff --git a/modules/docs/src/Volo.Docs.Application.Contracts/Volo/Docs/DocsApplicationContractsModule.cs b/modules/docs/src/Volo.Docs.Application.Contracts/Volo/Docs/DocsApplicationContractsModule.cs index 4d1a26d2d7..6c832aba8d 100644 --- a/modules/docs/src/Volo.Docs.Application.Contracts/Volo/Docs/DocsApplicationContractsModule.cs +++ b/modules/docs/src/Volo.Docs.Application.Contracts/Volo/Docs/DocsApplicationContractsModule.cs @@ -6,9 +6,9 @@ namespace Volo.Docs [DependsOn(typeof(DocsDomainSharedModule))] public class DocsApplicationContractsModule : AbpModule { - public override void ConfigureServices(IServiceCollection services) + public override void ConfigureServices(ServiceConfigurationContext context) { - services.AddAssemblyOf(); + context.Services.AddAssemblyOf(); } } } diff --git a/modules/docs/src/Volo.Docs.Application/Volo/Docs/DocsApplicationModule.cs b/modules/docs/src/Volo.Docs.Application/Volo/Docs/DocsApplicationModule.cs index acf5e05608..a2f73d85bf 100644 --- a/modules/docs/src/Volo.Docs.Application/Volo/Docs/DocsApplicationModule.cs +++ b/modules/docs/src/Volo.Docs.Application/Volo/Docs/DocsApplicationModule.cs @@ -12,14 +12,14 @@ namespace Volo.Docs typeof(AbpAutoMapperModule))] public class DocsApplicationModule : AbpModule { - public override void ConfigureServices(IServiceCollection services) + public override void ConfigureServices(ServiceConfigurationContext context) { - services.Configure(options => + context.Services.Configure(options => { options.AddProfile(validate: true); }); - services.AddAssemblyOf(); + context.Services.AddAssemblyOf(); } } } diff --git a/modules/docs/src/Volo.Docs.Domain.Shared/Volo/Docs/DocsDomainSharedModule.cs b/modules/docs/src/Volo.Docs.Domain.Shared/Volo/Docs/DocsDomainSharedModule.cs index e93855b351..bf6cc18cee 100644 --- a/modules/docs/src/Volo.Docs.Domain.Shared/Volo/Docs/DocsDomainSharedModule.cs +++ b/modules/docs/src/Volo.Docs.Domain.Shared/Volo/Docs/DocsDomainSharedModule.cs @@ -8,14 +8,14 @@ namespace Volo.Docs [DependsOn(typeof(AbpLocalizationModule))] public class DocsDomainSharedModule : AbpModule { - public override void ConfigureServices(IServiceCollection services) + public override void ConfigureServices(ServiceConfigurationContext context) { - services.Configure(options => + context.Services.Configure(options => { options.Resources.Add("en"); }); - services.AddAssemblyOf(); + context.Services.AddAssemblyOf(); } } } diff --git a/modules/docs/src/Volo.Docs.Domain/Volo/Docs/DocsDomainModule.cs b/modules/docs/src/Volo.Docs.Domain/Volo/Docs/DocsDomainModule.cs index 7045cd7c6c..00bd564ce1 100644 --- a/modules/docs/src/Volo.Docs.Domain/Volo/Docs/DocsDomainModule.cs +++ b/modules/docs/src/Volo.Docs.Domain/Volo/Docs/DocsDomainModule.cs @@ -9,9 +9,9 @@ namespace Volo.Docs typeof(AbpDddDomainModule))] public class DocsDomainModule : AbpModule { - public override void ConfigureServices(IServiceCollection services) + public override void ConfigureServices(ServiceConfigurationContext context) { - services.AddAssemblyOf(); + context.Services.AddAssemblyOf(); } } } diff --git a/modules/docs/src/Volo.Docs.EntityFrameworkCore/Volo/Docs/EntityFrameworkCore/DocsEntityFrameworkCoreModule.cs b/modules/docs/src/Volo.Docs.EntityFrameworkCore/Volo/Docs/EntityFrameworkCore/DocsEntityFrameworkCoreModule.cs index 5b440845a5..df6591b9d8 100644 --- a/modules/docs/src/Volo.Docs.EntityFrameworkCore/Volo/Docs/EntityFrameworkCore/DocsEntityFrameworkCoreModule.cs +++ b/modules/docs/src/Volo.Docs.EntityFrameworkCore/Volo/Docs/EntityFrameworkCore/DocsEntityFrameworkCoreModule.cs @@ -10,14 +10,14 @@ namespace Volo.Docs.EntityFrameworkCore typeof(AbpEntityFrameworkCoreModule))] public class DocsEntityFrameworkCoreModule : AbpModule { - public override void ConfigureServices(IServiceCollection services) + public override void ConfigureServices(ServiceConfigurationContext context) { - services.AddAbpDbContext(options => + context.Services.AddAbpDbContext(options => { options.AddRepository(); }); - services.AddAssemblyOf(); + context.Services.AddAssemblyOf(); } } } diff --git a/modules/docs/src/Volo.Docs.HttpApi.Client/Volo/Docs/DocsHttpApiClientModule.cs b/modules/docs/src/Volo.Docs.HttpApi.Client/Volo/Docs/DocsHttpApiClientModule.cs index cbfe881687..43afb4cfb6 100644 --- a/modules/docs/src/Volo.Docs.HttpApi.Client/Volo/Docs/DocsHttpApiClientModule.cs +++ b/modules/docs/src/Volo.Docs.HttpApi.Client/Volo/Docs/DocsHttpApiClientModule.cs @@ -7,9 +7,9 @@ namespace Volo.Docs typeof(DocsApplicationContractsModule))] public class DocsHttpApiClientModule : AbpModule { - public override void ConfigureServices(IServiceCollection services) + public override void ConfigureServices(ServiceConfigurationContext context) { - services.AddAssemblyOf(); + context.Services.AddAssemblyOf(); } } } diff --git a/modules/docs/src/Volo.Docs.HttpApi/Volo/Docs/DocsHttpApiModule.cs b/modules/docs/src/Volo.Docs.HttpApi/Volo/Docs/DocsHttpApiModule.cs index fd55300b1f..1afb9ab7fb 100644 --- a/modules/docs/src/Volo.Docs.HttpApi/Volo/Docs/DocsHttpApiModule.cs +++ b/modules/docs/src/Volo.Docs.HttpApi/Volo/Docs/DocsHttpApiModule.cs @@ -7,9 +7,9 @@ namespace Volo.Docs typeof(DocsApplicationContractsModule))] public class DocsHttpApiModule : AbpModule { - public override void ConfigureServices(IServiceCollection services) + public override void ConfigureServices(ServiceConfigurationContext context) { - services.AddAssemblyOf(); + context.Services.AddAssemblyOf(); } } } diff --git a/modules/docs/src/Volo.Docs.Web/DocsWebModule.cs b/modules/docs/src/Volo.Docs.Web/DocsWebModule.cs index d590cc585a..1e24df7341 100644 --- a/modules/docs/src/Volo.Docs.Web/DocsWebModule.cs +++ b/modules/docs/src/Volo.Docs.Web/DocsWebModule.cs @@ -14,28 +14,28 @@ namespace Volo.Docs )] public class DocsWebModule : AbpModule { - public override void PreConfigureServices(IServiceCollection services) + public override void PreConfigureServices(ServiceConfigurationContext context) { - services.PreConfigure(options => + context.Services.PreConfigure(options => { options.AddAssemblyResource(typeof(DocsResource), typeof(DocsWebModule).Assembly); }); } - public override void ConfigureServices(IServiceCollection services) + public override void ConfigureServices(ServiceConfigurationContext context) { - services.Configure(options => + context.Services.Configure(options => { options.FileSets.AddEmbedded("Volo.Docs"); }); - services.Configure(options => + context.Services.Configure(options => { //TODO: Make configurable! options.Conventions.AddPageRoute("/Documents/Project/Index", "documents/{projectName}/{version}/{*documentName}"); }); - services.AddAssemblyOf(); + context.Services.AddAssemblyOf(); } } } diff --git a/modules/identity/src/Volo.Abp.Identity.Application.Contracts/Volo/Abp/Identity/AbpIdentityApplicationContractsModule.cs b/modules/identity/src/Volo.Abp.Identity.Application.Contracts/Volo/Abp/Identity/AbpIdentityApplicationContractsModule.cs index b7deadb432..ac6d31b753 100644 --- a/modules/identity/src/Volo.Abp.Identity.Application.Contracts/Volo/Abp/Identity/AbpIdentityApplicationContractsModule.cs +++ b/modules/identity/src/Volo.Abp.Identity.Application.Contracts/Volo/Abp/Identity/AbpIdentityApplicationContractsModule.cs @@ -16,26 +16,26 @@ namespace Volo.Abp.Identity [DependsOn(typeof(AbpPermissionManagementApplicationContractsModule))] public class AbpIdentityApplicationContractsModule : AbpModule { - public override void ConfigureServices(IServiceCollection services) + public override void ConfigureServices(ServiceConfigurationContext context) { - services.Configure(options => + context.Services.Configure(options => { options.DefinitionProviders.Add(); }); - services.Configure(options => + context.Services.Configure(options => { options.FileSets.AddEmbedded(); }); - services.Configure(options => + context.Services.Configure(options => { options.Resources .Get() .AddVirtualJson("/Volo/Abp/Identity/Localization/ApplicationContracts"); }); - services.AddAssemblyOf(); + context.Services.AddAssemblyOf(); } } } \ No newline at end of file diff --git a/modules/identity/src/Volo.Abp.Identity.Application/Volo/Abp/Identity/AbpIdentityApplicationModule.cs b/modules/identity/src/Volo.Abp.Identity.Application/Volo/Abp/Identity/AbpIdentityApplicationModule.cs index fe258bf9c1..2f07ba3d5e 100644 --- a/modules/identity/src/Volo.Abp.Identity.Application/Volo/Abp/Identity/AbpIdentityApplicationModule.cs +++ b/modules/identity/src/Volo.Abp.Identity.Application/Volo/Abp/Identity/AbpIdentityApplicationModule.cs @@ -13,14 +13,14 @@ namespace Volo.Abp.Identity )] public class AbpIdentityApplicationModule : AbpModule { - public override void ConfigureServices(IServiceCollection services) + public override void ConfigureServices(ServiceConfigurationContext context) { - services.Configure(options => + context.Services.Configure(options => { options.AddProfile(); }); - services.AddAssemblyOf(); + context.Services.AddAssemblyOf(); } } } \ No newline at end of file diff --git a/modules/identity/src/Volo.Abp.Identity.Domain.Shared/Volo/Abp/Identity/AbpIdentityDomainSharedModule.cs b/modules/identity/src/Volo.Abp.Identity.Domain.Shared/Volo/Abp/Identity/AbpIdentityDomainSharedModule.cs index 07f4224dd5..d5114d62c4 100644 --- a/modules/identity/src/Volo.Abp.Identity.Domain.Shared/Volo/Abp/Identity/AbpIdentityDomainSharedModule.cs +++ b/modules/identity/src/Volo.Abp.Identity.Domain.Shared/Volo/Abp/Identity/AbpIdentityDomainSharedModule.cs @@ -10,14 +10,14 @@ namespace Volo.Abp.Identity [DependsOn(typeof(AbpLocalizationModule))] public class AbpIdentityDomainSharedModule : AbpModule { - public override void ConfigureServices(IServiceCollection services) + public override void ConfigureServices(ServiceConfigurationContext context) { - services.Configure(options => + context.Services.Configure(options => { options.Resources.Add("en"); }); - services.AddAssemblyOf(); + context.Services.AddAssemblyOf(); } } } diff --git a/modules/identity/src/Volo.Abp.Identity.Domain/Volo/Abp/Identity/AbpIdentityDomainModule.cs b/modules/identity/src/Volo.Abp.Identity.Domain/Volo/Abp/Identity/AbpIdentityDomainModule.cs index 26a7555b2c..f2836a7473 100644 --- a/modules/identity/src/Volo.Abp.Identity.Domain/Volo/Abp/Identity/AbpIdentityDomainModule.cs +++ b/modules/identity/src/Volo.Abp.Identity.Domain/Volo/Abp/Identity/AbpIdentityDomainModule.cs @@ -19,41 +19,41 @@ namespace Volo.Abp.Identity [DependsOn(typeof(AbpUsersDomainModule))] public class AbpIdentityDomainModule : AbpModule { - public override void ConfigureServices(IServiceCollection services) + public override void ConfigureServices(ServiceConfigurationContext context) { - services.Configure(options => + context.Services.Configure(options => { options.ManagementProviders.Add(); options.ManagementProviders.Add(); }); - services.Configure(options => + context.Services.Configure(options => { options.DefinitionProviders.Add(); }); - services.Configure(options => + context.Services.Configure(options => { options.FileSets.AddEmbedded(); }); - services.Configure(options => + context.Services.Configure(options => { options.Resources .Get() .AddVirtualJson("/Volo/Abp/Identity/Localization/Domain"); }); - var identityBuilder = services.AddAbpIdentity(options => + var identityBuilder = context.Services.AddAbpIdentity(options => { options.User.RequireUniqueEmail = true; }); - services.ExecutePreConfiguredActions(identityBuilder); + context.Services.ExecutePreConfiguredActions(identityBuilder); - AddAbpIdentityOptionsFactory(services); + AddAbpIdentityOptionsFactory(context.Services); - services.AddAssemblyOf(); + context.Services.AddAssemblyOf(); } private static void AddAbpIdentityOptionsFactory(IServiceCollection services) diff --git a/modules/identity/src/Volo.Abp.Identity.EntityFrameworkCore/Volo/Abp/Identity/EntityFrameworkCore/AbpIdentityEntityFrameworkCoreModule.cs b/modules/identity/src/Volo.Abp.Identity.EntityFrameworkCore/Volo/Abp/Identity/EntityFrameworkCore/AbpIdentityEntityFrameworkCoreModule.cs index bb8f8c582a..9fc4972bec 100644 --- a/modules/identity/src/Volo.Abp.Identity.EntityFrameworkCore/Volo/Abp/Identity/EntityFrameworkCore/AbpIdentityEntityFrameworkCoreModule.cs +++ b/modules/identity/src/Volo.Abp.Identity.EntityFrameworkCore/Volo/Abp/Identity/EntityFrameworkCore/AbpIdentityEntityFrameworkCoreModule.cs @@ -9,15 +9,15 @@ namespace Volo.Abp.Identity.EntityFrameworkCore typeof(AbpUsersEntityFrameworkCoreModule))] public class AbpIdentityEntityFrameworkCoreModule : AbpModule { - public override void ConfigureServices(IServiceCollection services) + public override void ConfigureServices(ServiceConfigurationContext context) { - services.AddAbpDbContext(options => + context.Services.AddAbpDbContext(options => { options.AddRepository(); options.AddRepository(); }); - services.AddAssemblyOf(); + context.Services.AddAssemblyOf(); } } } diff --git a/modules/identity/src/Volo.Abp.Identity.HttpApi.Client/Volo/Abp/Identity/AbpIdentityHttpApiClientModule.cs b/modules/identity/src/Volo.Abp.Identity.HttpApi.Client/Volo/Abp/Identity/AbpIdentityHttpApiClientModule.cs index b54712f521..6915ef8570 100644 --- a/modules/identity/src/Volo.Abp.Identity.HttpApi.Client/Volo/Abp/Identity/AbpIdentityHttpApiClientModule.cs +++ b/modules/identity/src/Volo.Abp.Identity.HttpApi.Client/Volo/Abp/Identity/AbpIdentityHttpApiClientModule.cs @@ -13,11 +13,11 @@ namespace Volo.Abp.Identity { public const string RemoteServiceName = "AbpIdentity"; - public override void ConfigureServices(IServiceCollection services) + public override void ConfigureServices(ServiceConfigurationContext context) { - services.AddHttpClientProxies(typeof(AbpIdentityApplicationContractsModule).Assembly, RemoteServiceName); + context.Services.AddHttpClientProxies(typeof(AbpIdentityApplicationContractsModule).Assembly, RemoteServiceName); - services.AddAssemblyOf(); + context.Services.AddAssemblyOf(); } } } \ No newline at end of file diff --git a/modules/identity/src/Volo.Abp.Identity.HttpApi/Volo/Abp/Identity/AbpIdentityHttpApiModule.cs b/modules/identity/src/Volo.Abp.Identity.HttpApi/Volo/Abp/Identity/AbpIdentityHttpApiModule.cs index 69891d1ccb..ba162d41db 100644 --- a/modules/identity/src/Volo.Abp.Identity.HttpApi/Volo/Abp/Identity/AbpIdentityHttpApiModule.cs +++ b/modules/identity/src/Volo.Abp.Identity.HttpApi/Volo/Abp/Identity/AbpIdentityHttpApiModule.cs @@ -7,9 +7,9 @@ namespace Volo.Abp.Identity [DependsOn(typeof(AbpIdentityApplicationContractsModule), typeof(AbpAspNetCoreMvcModule))] public class AbpIdentityHttpApiModule : AbpModule { - public override void ConfigureServices(IServiceCollection services) + public override void ConfigureServices(ServiceConfigurationContext context) { - services.AddAssemblyOf(); + context.Services.AddAssemblyOf(); } } } \ No newline at end of file diff --git a/modules/identity/src/Volo.Abp.Identity.MongoDB/Volo/Abp/Identity/MongoDB/AbpIdentityMongoDbModule.cs b/modules/identity/src/Volo.Abp.Identity.MongoDB/Volo/Abp/Identity/MongoDB/AbpIdentityMongoDbModule.cs index 426f2c78cd..5516083ba9 100644 --- a/modules/identity/src/Volo.Abp.Identity.MongoDB/Volo/Abp/Identity/MongoDB/AbpIdentityMongoDbModule.cs +++ b/modules/identity/src/Volo.Abp.Identity.MongoDB/Volo/Abp/Identity/MongoDB/AbpIdentityMongoDbModule.cs @@ -10,17 +10,17 @@ namespace Volo.Abp.Identity.MongoDB )] public class AbpIdentityMongoDbModule : AbpModule { - public override void ConfigureServices(IServiceCollection services) + public override void ConfigureServices(ServiceConfigurationContext context) { AbpIdentityBsonClassMap.Configure(); - services.AddMongoDbContext(options => + context.Services.AddMongoDbContext(options => { options.AddRepository(); options.AddRepository(); }); - services.AddAssemblyOf(); + context.Services.AddAssemblyOf(); } } } diff --git a/modules/identity/src/Volo.Abp.Identity.Web/AbpIdentityWebModule.cs b/modules/identity/src/Volo.Abp.Identity.Web/AbpIdentityWebModule.cs index 286324ec14..3285b5f8f0 100644 --- a/modules/identity/src/Volo.Abp.Identity.Web/AbpIdentityWebModule.cs +++ b/modules/identity/src/Volo.Abp.Identity.Web/AbpIdentityWebModule.cs @@ -21,27 +21,27 @@ namespace Volo.Abp.Identity.Web [DependsOn(typeof(AbpPermissionManagementWebModule))] public class AbpIdentityWebModule : AbpModule { - public override void PreConfigureServices(IServiceCollection services) + public override void PreConfigureServices(ServiceConfigurationContext context) { - services.PreConfigure(options => + context.Services.PreConfigure(options => { options.AddAssemblyResource(typeof(IdentityResource), typeof(AbpIdentityWebModule).Assembly); }); } - public override void ConfigureServices(IServiceCollection services) + public override void ConfigureServices(ServiceConfigurationContext context) { - services.Configure(options => + context.Services.Configure(options => { options.MenuContributors.Add(new AbpIdentityWebMainMenuContributor()); }); - services.Configure(options => + context.Services.Configure(options => { options.FileSets.AddEmbedded("Volo.Abp.Identity.Web"); }); - services.Configure(options => + context.Services.Configure(options => { options.Resources .Get() @@ -51,12 +51,12 @@ namespace Volo.Abp.Identity.Web ).AddVirtualJson("/Localization/Resources/AbpIdentity"); }); - services.Configure(options => + context.Services.Configure(options => { options.AddProfile(validate: true); }); - services.Configure(options => + context.Services.Configure(options => { options.Conventions.AuthorizePage("/Identity/Users/Index", IdentityPermissions.Users.Default); options.Conventions.AuthorizePage("/Identity/Users/CreateModal", IdentityPermissions.Users.Create); @@ -66,7 +66,7 @@ namespace Volo.Abp.Identity.Web options.Conventions.AuthorizePage("/Identity/Roles/EditModal", IdentityPermissions.Roles.Update); }); - services.AddAssemblyOf(); + context.Services.AddAssemblyOf(); } } } diff --git a/modules/identity/test/Volo.Abp.Identity.Application.Tests/Volo/Abp/Identity/AbpIdentityApplicationTestModule.cs b/modules/identity/test/Volo.Abp.Identity.Application.Tests/Volo/Abp/Identity/AbpIdentityApplicationTestModule.cs index 48da243a39..719327ccbb 100644 --- a/modules/identity/test/Volo.Abp.Identity.Application.Tests/Volo/Abp/Identity/AbpIdentityApplicationTestModule.cs +++ b/modules/identity/test/Volo.Abp.Identity.Application.Tests/Volo/Abp/Identity/AbpIdentityApplicationTestModule.cs @@ -9,9 +9,9 @@ namespace Volo.Abp.Identity )] public class AbpIdentityApplicationTestModule : AbpModule { - public override void ConfigureServices(IServiceCollection services) + public override void ConfigureServices(ServiceConfigurationContext context) { - services.AddAssemblyOf(); + context.Services.AddAssemblyOf(); } } } diff --git a/modules/identity/test/Volo.Abp.Identity.Domain.Tests/Volo/Abp/Identity/AbpIdentityDomainTestModule.cs b/modules/identity/test/Volo.Abp.Identity.Domain.Tests/Volo/Abp/Identity/AbpIdentityDomainTestModule.cs index ded3308fbb..3ea7d5b71e 100644 --- a/modules/identity/test/Volo.Abp.Identity.Domain.Tests/Volo/Abp/Identity/AbpIdentityDomainTestModule.cs +++ b/modules/identity/test/Volo.Abp.Identity.Domain.Tests/Volo/Abp/Identity/AbpIdentityDomainTestModule.cs @@ -8,14 +8,14 @@ namespace Volo.Abp.Identity [DependsOn(typeof(AbpIdentityEntityFrameworkCoreTestModule))] public class AbpIdentityDomainTestModule : AbpModule { - public override void ConfigureServices(IServiceCollection services) + public override void ConfigureServices(ServiceConfigurationContext context) { - services.Configure(options => + context.Services.Configure(options => { options.DefinitionProviders.Add(); }); - services.AddAssemblyOf(); + context.Services.AddAssemblyOf(); } public override void OnApplicationInitialization(ApplicationInitializationContext context) diff --git a/modules/identity/test/Volo.Abp.Identity.EntityFrameworkCore.Tests/Volo/Abp/Identity/EntityFrameworkCore/AbpIdentityEntityFrameworkCoreTestModule.cs b/modules/identity/test/Volo.Abp.Identity.EntityFrameworkCore.Tests/Volo/Abp/Identity/EntityFrameworkCore/AbpIdentityEntityFrameworkCoreTestModule.cs index 6ee1a35a3d..5d280fec9a 100644 --- a/modules/identity/test/Volo.Abp.Identity.EntityFrameworkCore.Tests/Volo/Abp/Identity/EntityFrameworkCore/AbpIdentityEntityFrameworkCoreTestModule.cs +++ b/modules/identity/test/Volo.Abp.Identity.EntityFrameworkCore.Tests/Volo/Abp/Identity/EntityFrameworkCore/AbpIdentityEntityFrameworkCoreTestModule.cs @@ -16,19 +16,19 @@ namespace Volo.Abp.Identity.EntityFrameworkCore )] public class AbpIdentityEntityFrameworkCoreTestModule : AbpModule { - public override void ConfigureServices(IServiceCollection services) + public override void ConfigureServices(ServiceConfigurationContext context) { var sqliteConnection = CreateDatabaseAndGetConnection(); - services.Configure(options => + context.Services.Configure(options => { - options.Configure(context => + options.Configure(abpDbContextConfigurationContext => { - context.DbContextOptions.UseSqlite(sqliteConnection); + abpDbContextConfigurationContext.DbContextOptions.UseSqlite(sqliteConnection); }); }); - services.AddAssemblyOf(); + context.Services.AddAssemblyOf(); } private static SqliteConnection CreateDatabaseAndGetConnection() diff --git a/modules/identity/test/Volo.Abp.Identity.MongoDB.Tests/Volo/Abp/Identity/MongoDB/AbpIdentityMongoDbTestModule.cs b/modules/identity/test/Volo.Abp.Identity.MongoDB.Tests/Volo/Abp/Identity/MongoDB/AbpIdentityMongoDbTestModule.cs index 8ac4ec3466..a75276e8ec 100644 --- a/modules/identity/test/Volo.Abp.Identity.MongoDB.Tests/Volo/Abp/Identity/MongoDB/AbpIdentityMongoDbTestModule.cs +++ b/modules/identity/test/Volo.Abp.Identity.MongoDB.Tests/Volo/Abp/Identity/MongoDB/AbpIdentityMongoDbTestModule.cs @@ -15,16 +15,16 @@ namespace Volo.Abp.Identity.MongoDB { private MongoDbRunner _mongoDbRunner; - public override void ConfigureServices(IServiceCollection services) + public override void ConfigureServices(ServiceConfigurationContext context) { _mongoDbRunner = MongoDbRunner.Start(); - services.Configure(options => + context.Services.Configure(options => { options.ConnectionStrings.Default = _mongoDbRunner.ConnectionString; }); - services.AddAssemblyOf(); + context.Services.AddAssemblyOf(); } public override void OnApplicationShutdown(ApplicationShutdownContext context) diff --git a/modules/identity/test/Volo.Abp.Identity.TestBase/Volo/Abp/Identity/AbpIdentityTestBaseModule.cs b/modules/identity/test/Volo.Abp.Identity.TestBase/Volo/Abp/Identity/AbpIdentityTestBaseModule.cs index 398b9ed6df..bafe2816a5 100644 --- a/modules/identity/test/Volo.Abp.Identity.TestBase/Volo/Abp/Identity/AbpIdentityTestBaseModule.cs +++ b/modules/identity/test/Volo.Abp.Identity.TestBase/Volo/Abp/Identity/AbpIdentityTestBaseModule.cs @@ -12,11 +12,11 @@ namespace Volo.Abp.Identity )] public class AbpIdentityTestBaseModule : AbpModule { - public override void ConfigureServices(IServiceCollection services) + public override void ConfigureServices(ServiceConfigurationContext context) { - services.AddAlwaysAllowPermissionChecker(); - - services.AddAssemblyOf(); + context.Services.AddAlwaysAllowPermissionChecker(); + + context.Services.AddAssemblyOf(); } public override void OnApplicationInitialization(ApplicationInitializationContext context) diff --git a/modules/permission-management/src/Volo.Abp.PermissionManagement.Application.Contracts/Volo/Abp/PermissionManagement/AbpPermissionManagementApplicationContractsModule.cs b/modules/permission-management/src/Volo.Abp.PermissionManagement.Application.Contracts/Volo/Abp/PermissionManagement/AbpPermissionManagementApplicationContractsModule.cs index e3f9289b7f..6efc10bd5a 100644 --- a/modules/permission-management/src/Volo.Abp.PermissionManagement.Application.Contracts/Volo/Abp/PermissionManagement/AbpPermissionManagementApplicationContractsModule.cs +++ b/modules/permission-management/src/Volo.Abp.PermissionManagement.Application.Contracts/Volo/Abp/PermissionManagement/AbpPermissionManagementApplicationContractsModule.cs @@ -8,9 +8,9 @@ namespace Volo.Abp.PermissionManagement [DependsOn(typeof(AbpPermissionManagementDomainSharedModule))] public class AbpPermissionManagementApplicationContractsModule : AbpModule { - public override void ConfigureServices(IServiceCollection services) + public override void ConfigureServices(ServiceConfigurationContext context) { - services.AddAssemblyOf(); + context.Services.AddAssemblyOf(); } } } diff --git a/modules/permission-management/src/Volo.Abp.PermissionManagement.Application/Volo/Abp/PermissionManagement/AbpPermissionManagementApplicationModule.cs b/modules/permission-management/src/Volo.Abp.PermissionManagement.Application/Volo/Abp/PermissionManagement/AbpPermissionManagementApplicationModule.cs index 7efc7ecc26..5a47c54ee3 100644 --- a/modules/permission-management/src/Volo.Abp.PermissionManagement.Application/Volo/Abp/PermissionManagement/AbpPermissionManagementApplicationModule.cs +++ b/modules/permission-management/src/Volo.Abp.PermissionManagement.Application/Volo/Abp/PermissionManagement/AbpPermissionManagementApplicationModule.cs @@ -7,9 +7,9 @@ namespace Volo.Abp.PermissionManagement [DependsOn(typeof(AbpPermissionManagementApplicationContractsModule))] public class AbpPermissionManagementApplicationModule : AbpModule { - public override void ConfigureServices(IServiceCollection services) + public override void ConfigureServices(ServiceConfigurationContext context) { - services.AddAssemblyOf(); + context.Services.AddAssemblyOf(); } } } diff --git a/modules/permission-management/src/Volo.Abp.PermissionManagement.Domain.Shared/Volo/Abp/PermissionManagement/AbpPermissionManagementDomainSharedModule.cs b/modules/permission-management/src/Volo.Abp.PermissionManagement.Domain.Shared/Volo/Abp/PermissionManagement/AbpPermissionManagementDomainSharedModule.cs index a9666c0e26..583bb3f186 100644 --- a/modules/permission-management/src/Volo.Abp.PermissionManagement.Domain.Shared/Volo/Abp/PermissionManagement/AbpPermissionManagementDomainSharedModule.cs +++ b/modules/permission-management/src/Volo.Abp.PermissionManagement.Domain.Shared/Volo/Abp/PermissionManagement/AbpPermissionManagementDomainSharedModule.cs @@ -5,9 +5,9 @@ namespace Volo.Abp.PermissionManagement { public class AbpPermissionManagementDomainSharedModule : AbpModule { - public override void ConfigureServices(IServiceCollection services) + public override void ConfigureServices(ServiceConfigurationContext context) { - services.AddAssemblyOf(); + context.Services.AddAssemblyOf(); } } } diff --git a/modules/permission-management/src/Volo.Abp.PermissionManagement.Domain/Volo/Abp/PermissionManagement/AbpPermissionManagementDomainModule.cs b/modules/permission-management/src/Volo.Abp.PermissionManagement.Domain/Volo/Abp/PermissionManagement/AbpPermissionManagementDomainModule.cs index 714c019e7f..4aa5f178b6 100644 --- a/modules/permission-management/src/Volo.Abp.PermissionManagement.Domain/Volo/Abp/PermissionManagement/AbpPermissionManagementDomainModule.cs +++ b/modules/permission-management/src/Volo.Abp.PermissionManagement.Domain/Volo/Abp/PermissionManagement/AbpPermissionManagementDomainModule.cs @@ -14,9 +14,9 @@ namespace Volo.Abp.PermissionManagement [DependsOn(typeof(AbpJsonModule))] public class AbpPermissionManagementDomainModule : AbpModule { - public override void ConfigureServices(IServiceCollection services) + public override void ConfigureServices(ServiceConfigurationContext context) { - services.AddAssemblyOf(); + context.Services.AddAssemblyOf(); } } } diff --git a/modules/permission-management/src/Volo.Abp.PermissionManagement.EntityFrameworkCore/Volo/Abp/PermissionManagement/EntityFrameworkCore/AbpPermissionManagementEntityFrameworkCoreModule.cs b/modules/permission-management/src/Volo.Abp.PermissionManagement.EntityFrameworkCore/Volo/Abp/PermissionManagement/EntityFrameworkCore/AbpPermissionManagementEntityFrameworkCoreModule.cs index cd9b296ae0..2477423904 100644 --- a/modules/permission-management/src/Volo.Abp.PermissionManagement.EntityFrameworkCore/Volo/Abp/PermissionManagement/EntityFrameworkCore/AbpPermissionManagementEntityFrameworkCoreModule.cs +++ b/modules/permission-management/src/Volo.Abp.PermissionManagement.EntityFrameworkCore/Volo/Abp/PermissionManagement/EntityFrameworkCore/AbpPermissionManagementEntityFrameworkCoreModule.cs @@ -8,16 +8,16 @@ namespace Volo.Abp.PermissionManagement.EntityFrameworkCore [DependsOn(typeof(AbpEntityFrameworkCoreModule))] public class AbpPermissionManagementEntityFrameworkCoreModule : AbpModule { - public override void ConfigureServices(IServiceCollection services) + public override void ConfigureServices(ServiceConfigurationContext context) { - services.AddAbpDbContext(options => + context.Services.AddAbpDbContext(options => { options.AddDefaultRepositories(); options.AddRepository(); }); - services.AddAssemblyOf(); + context.Services.AddAssemblyOf(); } } } diff --git a/modules/permission-management/src/Volo.Abp.PermissionManagement.MongoDB/Volo/Abp/PermissionManagement/MongoDb/AbpPermissionManagementMongoDbModule.cs b/modules/permission-management/src/Volo.Abp.PermissionManagement.MongoDB/Volo/Abp/PermissionManagement/MongoDb/AbpPermissionManagementMongoDbModule.cs index 10e1b9c78f..ea6f08a2fb 100644 --- a/modules/permission-management/src/Volo.Abp.PermissionManagement.MongoDB/Volo/Abp/PermissionManagement/MongoDb/AbpPermissionManagementMongoDbModule.cs +++ b/modules/permission-management/src/Volo.Abp.PermissionManagement.MongoDB/Volo/Abp/PermissionManagement/MongoDb/AbpPermissionManagementMongoDbModule.cs @@ -11,18 +11,18 @@ namespace Volo.Abp.PermissionManagement.MongoDB )] public class AbpPermissionManagementMongoDbModule : AbpModule { - public override void ConfigureServices(IServiceCollection services) + public override void ConfigureServices(ServiceConfigurationContext context) { AbpPermissionManagementBsonClassMap.Configure(); - services.AddMongoDbContext(options => + context.Services.AddMongoDbContext(options => { options.AddDefaultRepositories(); options.AddRepository(); }); - services.AddAssemblyOf(); + context.Services.AddAssemblyOf(); } } } diff --git a/modules/permission-management/src/Volo.Abp.PermissionManagement.Web/AbpPermissionManagementWebModule.cs b/modules/permission-management/src/Volo.Abp.PermissionManagement.Web/AbpPermissionManagementWebModule.cs index 075b4574d7..3bbdf519ca 100644 --- a/modules/permission-management/src/Volo.Abp.PermissionManagement.Web/AbpPermissionManagementWebModule.cs +++ b/modules/permission-management/src/Volo.Abp.PermissionManagement.Web/AbpPermissionManagementWebModule.cs @@ -14,31 +14,31 @@ namespace Volo.Abp.PermissionManagement.Web [DependsOn(typeof(AbpAutoMapperModule))] public class AbpPermissionManagementWebModule : AbpModule { - public override void PreConfigureServices(IServiceCollection services) + public override void PreConfigureServices(ServiceConfigurationContext context) { - services.PreConfigure(options => + context.Services.PreConfigure(options => { options.AddAssemblyResource(typeof(AbpPermissionManagementResource)); }); } - public override void ConfigureServices(IServiceCollection services) + public override void ConfigureServices(ServiceConfigurationContext context) { - services.AddAssemblyOf(); + context.Services.AddAssemblyOf(); - services.Configure(options => + context.Services.Configure(options => { options.FileSets.AddEmbedded("Volo.Abp.PermissionManagement.Web"); }); - - services.Configure(options => + + context.Services.Configure(options => { options.Resources .Add("en") .AddVirtualJson("/Localization/Resources/AbpPermissionManagement"); }); - services.Configure(options => + context.Services.Configure(options => { options.AddProfile(validate: true); }); diff --git a/modules/permission-management/test/Volo.Abp.PermissionManagement.EntityFrameworkCore.Tests/Volo/Abp/PermissionManagement/EntityFrameworkCore/AbpPermissionManagementEntityFrameworkCoreTestModule.cs b/modules/permission-management/test/Volo.Abp.PermissionManagement.EntityFrameworkCore.Tests/Volo/Abp/PermissionManagement/EntityFrameworkCore/AbpPermissionManagementEntityFrameworkCoreTestModule.cs index 5bccbccf6e..cdaa58e67d 100644 --- a/modules/permission-management/test/Volo.Abp.PermissionManagement.EntityFrameworkCore.Tests/Volo/Abp/PermissionManagement/EntityFrameworkCore/AbpPermissionManagementEntityFrameworkCoreTestModule.cs +++ b/modules/permission-management/test/Volo.Abp.PermissionManagement.EntityFrameworkCore.Tests/Volo/Abp/PermissionManagement/EntityFrameworkCore/AbpPermissionManagementEntityFrameworkCoreTestModule.cs @@ -12,26 +12,26 @@ namespace Volo.Abp.PermissionManagement.EntityFrameworkCore typeof(AbpPermissionManagementTestBaseModule))] public class AbpPermissionManagementEntityFrameworkCoreTestModule : AbpModule { - public override void ConfigureServices(IServiceCollection services) + public override void ConfigureServices(ServiceConfigurationContext context) { - services.AddEntityFrameworkInMemoryDatabase(); + context.Services.AddEntityFrameworkInMemoryDatabase(); var databaseName = Guid.NewGuid().ToString(); - services.Configure(options => + context.Services.Configure(options => { - options.Configure(context => + options.Configure(abpDbContextConfigurationContext => { - context.DbContextOptions.UseInMemoryDatabase(databaseName); + abpDbContextConfigurationContext.DbContextOptions.UseInMemoryDatabase(databaseName); }); }); - services.Configure(options => + context.Services.Configure(options => { options.TransactionBehavior = UnitOfWorkTransactionBehavior.Disabled; //EF in-memory database does not support transactions }); - services.AddAssemblyOf(); + context.Services.AddAssemblyOf(); } } } diff --git a/modules/permission-management/test/Volo.Abp.PermissionManagement.MongoDB.Tests/Volo/Abp/PermissionManagement/MongoDb/AbpPermissionManagementMongoDbTestModule.cs b/modules/permission-management/test/Volo.Abp.PermissionManagement.MongoDB.Tests/Volo/Abp/PermissionManagement/MongoDb/AbpPermissionManagementMongoDbTestModule.cs index fe8b507a97..5097d79412 100644 --- a/modules/permission-management/test/Volo.Abp.PermissionManagement.MongoDB.Tests/Volo/Abp/PermissionManagement/MongoDb/AbpPermissionManagementMongoDbTestModule.cs +++ b/modules/permission-management/test/Volo.Abp.PermissionManagement.MongoDB.Tests/Volo/Abp/PermissionManagement/MongoDb/AbpPermissionManagementMongoDbTestModule.cs @@ -13,16 +13,16 @@ namespace Volo.Abp.PermissionManagement.MongoDb { private MongoDbRunner _mongoDbRunner; - public override void ConfigureServices(IServiceCollection services) + public override void ConfigureServices(ServiceConfigurationContext context) { _mongoDbRunner = MongoDbRunner.Start(); - services.Configure(options => + context.Services.Configure(options => { options.ConnectionStrings.Default = _mongoDbRunner.ConnectionString; }); - services.AddAssemblyOf(); + context.Services.AddAssemblyOf(); } public override void OnApplicationShutdown(ApplicationShutdownContext context) diff --git a/modules/permission-management/test/Volo.Abp.PermissionManagement.TestBase/Volo/Abp/PermissionManagement/AbpPermissionManagementTestBaseModule.cs b/modules/permission-management/test/Volo.Abp.PermissionManagement.TestBase/Volo/Abp/PermissionManagement/AbpPermissionManagementTestBaseModule.cs index d0aa4f4307..666bdcc27a 100644 --- a/modules/permission-management/test/Volo.Abp.PermissionManagement.TestBase/Volo/Abp/PermissionManagement/AbpPermissionManagementTestBaseModule.cs +++ b/modules/permission-management/test/Volo.Abp.PermissionManagement.TestBase/Volo/Abp/PermissionManagement/AbpPermissionManagementTestBaseModule.cs @@ -12,14 +12,14 @@ namespace Volo.Abp.PermissionManagement )] public class AbpPermissionManagementTestBaseModule : AbpModule { - public override void ConfigureServices(IServiceCollection services) + public override void ConfigureServices(ServiceConfigurationContext context) { - services.Configure(options => + context.Services.Configure(options => { options.DefinitionProviders.Add(); }); - services.AddAssemblyOf(); + context.Services.AddAssemblyOf(); } public override void OnApplicationInitialization(ApplicationInitializationContext context) diff --git a/modules/permission-management/test/Volo.Abp.PermissionManagement.Tests/Volo/Abp/PermissionManagement/AbpPermissionManagementTestModule.cs b/modules/permission-management/test/Volo.Abp.PermissionManagement.Tests/Volo/Abp/PermissionManagement/AbpPermissionManagementTestModule.cs index dfe18255a4..931e3e9b96 100644 --- a/modules/permission-management/test/Volo.Abp.PermissionManagement.Tests/Volo/Abp/PermissionManagement/AbpPermissionManagementTestModule.cs +++ b/modules/permission-management/test/Volo.Abp.PermissionManagement.Tests/Volo/Abp/PermissionManagement/AbpPermissionManagementTestModule.cs @@ -13,26 +13,26 @@ namespace Volo.Abp.PermissionManagement typeof(AbpPermissionManagementTestBaseModule))] public class AbpPermissionManagementTestModule : AbpModule { - public override void ConfigureServices(IServiceCollection services) + public override void ConfigureServices(ServiceConfigurationContext context) { - services.AddEntityFrameworkInMemoryDatabase(); + context.Services.AddEntityFrameworkInMemoryDatabase(); var databaseName = Guid.NewGuid().ToString(); - services.Configure(options => + context.Services.Configure(options => { - options.Configure(context => + options.Configure(abpDbContextConfigurationContext => { - context.DbContextOptions.UseInMemoryDatabase(databaseName); + abpDbContextConfigurationContext.DbContextOptions.UseInMemoryDatabase(databaseName); }); }); - services.Configure(options => + context.Services.Configure(options => { options.TransactionBehavior = UnitOfWorkTransactionBehavior.Disabled; //EF in-memory database does not support transactions }); - services.AddAssemblyOf(); + context.Services.AddAssemblyOf(); } } } diff --git a/modules/setting-management/src/Volo.Abp.SettingManagement.Domain.Shared/Volo/Abp/SettingManagement/AbpSettingManagementDomainSharedModule.cs b/modules/setting-management/src/Volo.Abp.SettingManagement.Domain.Shared/Volo/Abp/SettingManagement/AbpSettingManagementDomainSharedModule.cs index d489813551..41af8db8ce 100644 --- a/modules/setting-management/src/Volo.Abp.SettingManagement.Domain.Shared/Volo/Abp/SettingManagement/AbpSettingManagementDomainSharedModule.cs +++ b/modules/setting-management/src/Volo.Abp.SettingManagement.Domain.Shared/Volo/Abp/SettingManagement/AbpSettingManagementDomainSharedModule.cs @@ -5,9 +5,9 @@ namespace Volo.Abp.SettingManagement { public class AbpSettingManagementDomainSharedModule : AbpModule { - public override void ConfigureServices(IServiceCollection services) + public override void ConfigureServices(ServiceConfigurationContext context) { - services.AddAssemblyOf(); + context.Services.AddAssemblyOf(); } } } diff --git a/modules/setting-management/src/Volo.Abp.SettingManagement.Domain/Volo/Abp/SettingManagement/AbpSettingManagementDomainModule.cs b/modules/setting-management/src/Volo.Abp.SettingManagement.Domain/Volo/Abp/SettingManagement/AbpSettingManagementDomainModule.cs index 52522a69f6..ea72234a55 100644 --- a/modules/setting-management/src/Volo.Abp.SettingManagement.Domain/Volo/Abp/SettingManagement/AbpSettingManagementDomainModule.cs +++ b/modules/setting-management/src/Volo.Abp.SettingManagement.Domain/Volo/Abp/SettingManagement/AbpSettingManagementDomainModule.cs @@ -10,9 +10,9 @@ namespace Volo.Abp.SettingManagement [DependsOn(typeof(AbpSettingManagementDomainSharedModule))] public class AbpSettingManagementDomainModule : AbpModule { - public override void ConfigureServices(IServiceCollection services) + public override void ConfigureServices(ServiceConfigurationContext context) { - services.AddAssemblyOf(); + context.Services.AddAssemblyOf(); } } } diff --git a/modules/setting-management/src/Volo.Abp.SettingManagement.EntityFrameworkCore/Volo/Abp/SettingManagement/EntityFrameworkCore/AbpSettingManagementEntityFrameworkCoreModule.cs b/modules/setting-management/src/Volo.Abp.SettingManagement.EntityFrameworkCore/Volo/Abp/SettingManagement/EntityFrameworkCore/AbpSettingManagementEntityFrameworkCoreModule.cs index 5ec4dd9045..83fa9957ec 100644 --- a/modules/setting-management/src/Volo.Abp.SettingManagement.EntityFrameworkCore/Volo/Abp/SettingManagement/EntityFrameworkCore/AbpSettingManagementEntityFrameworkCoreModule.cs +++ b/modules/setting-management/src/Volo.Abp.SettingManagement.EntityFrameworkCore/Volo/Abp/SettingManagement/EntityFrameworkCore/AbpSettingManagementEntityFrameworkCoreModule.cs @@ -8,16 +8,16 @@ namespace Volo.Abp.SettingManagement.EntityFrameworkCore [DependsOn(typeof(AbpEntityFrameworkCoreModule))] public class AbpSettingManagementEntityFrameworkCoreModule : AbpModule { - public override void ConfigureServices(IServiceCollection services) + public override void ConfigureServices(ServiceConfigurationContext context) { - services.AddAbpDbContext(options => + context.Services.AddAbpDbContext(options => { options.AddDefaultRepositories(); options.AddRepository(); }); - services.AddAssemblyOf(); + context.Services.AddAssemblyOf(); } } } diff --git a/modules/setting-management/src/Volo.Abp.SettingManagement.MongoDB/Volo/Abp/SettingManagement/MongoDB/AbpSettingManagementMongoDbModule.cs b/modules/setting-management/src/Volo.Abp.SettingManagement.MongoDB/Volo/Abp/SettingManagement/MongoDB/AbpSettingManagementMongoDbModule.cs index 3a74663598..1aab00752b 100644 --- a/modules/setting-management/src/Volo.Abp.SettingManagement.MongoDB/Volo/Abp/SettingManagement/MongoDB/AbpSettingManagementMongoDbModule.cs +++ b/modules/setting-management/src/Volo.Abp.SettingManagement.MongoDB/Volo/Abp/SettingManagement/MongoDB/AbpSettingManagementMongoDbModule.cs @@ -10,18 +10,18 @@ namespace Volo.Abp.SettingManagement.MongoDB )] public class AbpSettingManagementMongoDbModule : AbpModule { - public override void ConfigureServices(IServiceCollection services) + public override void ConfigureServices(ServiceConfigurationContext context) { AbpSettingManagementBsonClassMap.Configure(); - services.AddMongoDbContext(options => + context.Services.AddMongoDbContext(options => { options.AddDefaultRepositories(); options.AddRepository(); }); - services.AddAssemblyOf(); + context.Services.AddAssemblyOf(); } } } diff --git a/modules/setting-management/test/Volo.Abp.SettingManagement.EntityFrameworkCore.Tests/Volo/Abp/SettingManagement/EntityFrameworkCore/AbpSettingManagementEntityFrameworkCoreTestModule.cs b/modules/setting-management/test/Volo.Abp.SettingManagement.EntityFrameworkCore.Tests/Volo/Abp/SettingManagement/EntityFrameworkCore/AbpSettingManagementEntityFrameworkCoreTestModule.cs index 1bc2ae5fdd..3a269e080d 100644 --- a/modules/setting-management/test/Volo.Abp.SettingManagement.EntityFrameworkCore.Tests/Volo/Abp/SettingManagement/EntityFrameworkCore/AbpSettingManagementEntityFrameworkCoreTestModule.cs +++ b/modules/setting-management/test/Volo.Abp.SettingManagement.EntityFrameworkCore.Tests/Volo/Abp/SettingManagement/EntityFrameworkCore/AbpSettingManagementEntityFrameworkCoreTestModule.cs @@ -14,19 +14,19 @@ namespace Volo.Abp.SettingManagement.EntityFrameworkCore )] public class AbpSettingManagementEntityFrameworkCoreTestModule : AbpModule { - public override void ConfigureServices(IServiceCollection services) + public override void ConfigureServices(ServiceConfigurationContext context) { var sqliteConnection = CreateDatabaseAndGetConnection(); - services.Configure(options => + context.Services.Configure(options => { - options.Configure(context => + options.Configure(abpDbContextConfigurationContext => { - context.DbContextOptions.UseSqlite(sqliteConnection); + abpDbContextConfigurationContext.DbContextOptions.UseSqlite(sqliteConnection); }); }); - services.AddAssemblyOf(); + context.Services.AddAssemblyOf(); } private static SqliteConnection CreateDatabaseAndGetConnection() diff --git a/modules/setting-management/test/Volo.Abp.SettingManagement.MongoDB.Tests/Volo/Abp/SettingManagement/MongoDB/AbpSettingManagementMongoDbTestModule.cs b/modules/setting-management/test/Volo.Abp.SettingManagement.MongoDB.Tests/Volo/Abp/SettingManagement/MongoDB/AbpSettingManagementMongoDbTestModule.cs index c3e4c177aa..1889048efa 100644 --- a/modules/setting-management/test/Volo.Abp.SettingManagement.MongoDB.Tests/Volo/Abp/SettingManagement/MongoDB/AbpSettingManagementMongoDbTestModule.cs +++ b/modules/setting-management/test/Volo.Abp.SettingManagement.MongoDB.Tests/Volo/Abp/SettingManagement/MongoDB/AbpSettingManagementMongoDbTestModule.cs @@ -13,16 +13,16 @@ namespace Volo.Abp.SettingManagement.MongoDB { private MongoDbRunner _mongoDbRunner; - public override void ConfigureServices(IServiceCollection services) + public override void ConfigureServices(ServiceConfigurationContext context) { _mongoDbRunner = MongoDbRunner.Start(); - services.Configure(options => + context.Services.Configure(options => { options.ConnectionStrings.Default = _mongoDbRunner.ConnectionString; }); - services.AddAssemblyOf(); + context.Services.AddAssemblyOf(); } public override void OnApplicationShutdown(ApplicationShutdownContext context) diff --git a/modules/setting-management/test/Volo.Abp.SettingManagement.TestBase/Volo/Abp/SettingManagement/AbpSettingManagementTestBaseModule.cs b/modules/setting-management/test/Volo.Abp.SettingManagement.TestBase/Volo/Abp/SettingManagement/AbpSettingManagementTestBaseModule.cs index 53c66d29e0..d7f2727549 100644 --- a/modules/setting-management/test/Volo.Abp.SettingManagement.TestBase/Volo/Abp/SettingManagement/AbpSettingManagementTestBaseModule.cs +++ b/modules/setting-management/test/Volo.Abp.SettingManagement.TestBase/Volo/Abp/SettingManagement/AbpSettingManagementTestBaseModule.cs @@ -11,14 +11,14 @@ namespace Volo.Abp.SettingManagement typeof(AbpSettingManagementDomainModule))] public class AbpSettingManagementTestBaseModule : AbpModule { - public override void ConfigureServices(IServiceCollection services) + public override void ConfigureServices(ServiceConfigurationContext context) { - services.Configure(options => + context.Services.Configure(options => { options.DefinitionProviders.Add(); }); - services.AddAssemblyOf(); + context.Services.AddAssemblyOf(); } public override void OnApplicationInitialization(ApplicationInitializationContext context) diff --git a/modules/setting-management/test/Volo.Abp.SettingManagement.Tests/Volo/Abp/SettingManagement/AbpSettingManagementTestModule.cs b/modules/setting-management/test/Volo.Abp.SettingManagement.Tests/Volo/Abp/SettingManagement/AbpSettingManagementTestModule.cs index d4360849a3..3141e10c8d 100644 --- a/modules/setting-management/test/Volo.Abp.SettingManagement.Tests/Volo/Abp/SettingManagement/AbpSettingManagementTestModule.cs +++ b/modules/setting-management/test/Volo.Abp.SettingManagement.Tests/Volo/Abp/SettingManagement/AbpSettingManagementTestModule.cs @@ -10,9 +10,9 @@ namespace Volo.Abp.SettingManagement typeof(AbpUsersAbstractionModule))] public class AbpSettingManagementTestModule : AbpModule //TODO: Rename to Volo.Abp.SettingManagement.Domain.Tests..? { - public override void ConfigureServices(IServiceCollection services) + public override void ConfigureServices(ServiceConfigurationContext context) { - services.AddAssemblyOf(); + context.Services.AddAssemblyOf(); } } } diff --git a/modules/tenant-management/src/Volo.Abp.TenantManagement.Application.Contracts/Volo/Abp/TenantManagement/AbpTenantManagementApplicationContractsModule.cs b/modules/tenant-management/src/Volo.Abp.TenantManagement.Application.Contracts/Volo/Abp/TenantManagement/AbpTenantManagementApplicationContractsModule.cs index a049d96f92..98a111563f 100644 --- a/modules/tenant-management/src/Volo.Abp.TenantManagement.Application.Contracts/Volo/Abp/TenantManagement/AbpTenantManagementApplicationContractsModule.cs +++ b/modules/tenant-management/src/Volo.Abp.TenantManagement.Application.Contracts/Volo/Abp/TenantManagement/AbpTenantManagementApplicationContractsModule.cs @@ -12,26 +12,26 @@ namespace Volo.Abp.TenantManagement [DependsOn(typeof(AbpTenantManagementDomainSharedModule))] public class AbpTenantManagementApplicationContractsModule : AbpModule { - public override void ConfigureServices(IServiceCollection services) + public override void ConfigureServices(ServiceConfigurationContext context) { - services.Configure(options => + context.Services.Configure(options => { options.DefinitionProviders.Add(); }); - services.Configure(options => + context.Services.Configure(options => { options.FileSets.AddEmbedded(); }); - services.Configure(options => + context.Services.Configure(options => { options.Resources .Get() .AddVirtualJson("/Volo/Abp/TenantManagement/Localization/ApplicationContracts"); }); - services.AddAssemblyOf(); + context.Services.AddAssemblyOf(); } } } \ No newline at end of file diff --git a/modules/tenant-management/src/Volo.Abp.TenantManagement.Application/Volo/Abp/TenantManagement/AbpTenantManagementApplicationModule.cs b/modules/tenant-management/src/Volo.Abp.TenantManagement.Application/Volo/Abp/TenantManagement/AbpTenantManagementApplicationModule.cs index 2cf0213119..3195a21768 100644 --- a/modules/tenant-management/src/Volo.Abp.TenantManagement.Application/Volo/Abp/TenantManagement/AbpTenantManagementApplicationModule.cs +++ b/modules/tenant-management/src/Volo.Abp.TenantManagement.Application/Volo/Abp/TenantManagement/AbpTenantManagementApplicationModule.cs @@ -8,14 +8,14 @@ namespace Volo.Abp.TenantManagement [DependsOn(typeof(AbpTenantManagementApplicationContractsModule))] public class AbpTenantManagementApplicationModule : AbpModule { - public override void ConfigureServices(IServiceCollection services) + public override void ConfigureServices(ServiceConfigurationContext context) { - services.Configure(options => + context.Services.Configure(options => { options.AddProfile(validate: true); }); - services.AddAssemblyOf(); + context.Services.AddAssemblyOf(); } } } \ No newline at end of file diff --git a/modules/tenant-management/src/Volo.Abp.TenantManagement.Domain.Shared/Volo/Abp/TenantManagement/AbpTenantManagementDomainSharedModule.cs b/modules/tenant-management/src/Volo.Abp.TenantManagement.Domain.Shared/Volo/Abp/TenantManagement/AbpTenantManagementDomainSharedModule.cs index 3ac78b5030..ed70f72113 100644 --- a/modules/tenant-management/src/Volo.Abp.TenantManagement.Domain.Shared/Volo/Abp/TenantManagement/AbpTenantManagementDomainSharedModule.cs +++ b/modules/tenant-management/src/Volo.Abp.TenantManagement.Domain.Shared/Volo/Abp/TenantManagement/AbpTenantManagementDomainSharedModule.cs @@ -7,14 +7,14 @@ namespace Volo.Abp.TenantManagement { public class AbpTenantManagementDomainSharedModule : AbpModule { - public override void ConfigureServices(IServiceCollection services) + public override void ConfigureServices(ServiceConfigurationContext context) { - services.Configure(options => + context.Services.Configure(options => { options.Resources.Add("en"); }); - services.AddAssemblyOf(); + context.Services.AddAssemblyOf(); } } } diff --git a/modules/tenant-management/src/Volo.Abp.TenantManagement.Domain/Volo/Abp/TenantManagement/AbpTenantManagementDomainModule.cs b/modules/tenant-management/src/Volo.Abp.TenantManagement.Domain/Volo/Abp/TenantManagement/AbpTenantManagementDomainModule.cs index 209fa47c79..fedfc10731 100644 --- a/modules/tenant-management/src/Volo.Abp.TenantManagement.Domain/Volo/Abp/TenantManagement/AbpTenantManagementDomainModule.cs +++ b/modules/tenant-management/src/Volo.Abp.TenantManagement.Domain/Volo/Abp/TenantManagement/AbpTenantManagementDomainModule.cs @@ -16,14 +16,14 @@ namespace Volo.Abp.TenantManagement [DependsOn(typeof(AbpUiModule))] //TODO: It's not good to depend on the UI module. However, UserFriendlyException is inside it! public class AbpTenantManagementDomainModule : AbpModule { - public override void ConfigureServices(IServiceCollection services) + public override void ConfigureServices(ServiceConfigurationContext context) { - services.Configure(options => + context.Services.Configure(options => { options.AddProfile(validate: true); }); - services.AddAssemblyOf(); + context.Services.AddAssemblyOf(); } } } diff --git a/modules/tenant-management/src/Volo.Abp.TenantManagement.EntityFrameworkCore/Volo/Abp/TenantManagement/EntityFrameworkCore/AbpTenantManagementEntityFrameworkCoreModule.cs b/modules/tenant-management/src/Volo.Abp.TenantManagement.EntityFrameworkCore/Volo/Abp/TenantManagement/EntityFrameworkCore/AbpTenantManagementEntityFrameworkCoreModule.cs index 809b1e805e..77938870b3 100644 --- a/modules/tenant-management/src/Volo.Abp.TenantManagement.EntityFrameworkCore/Volo/Abp/TenantManagement/EntityFrameworkCore/AbpTenantManagementEntityFrameworkCoreModule.cs +++ b/modules/tenant-management/src/Volo.Abp.TenantManagement.EntityFrameworkCore/Volo/Abp/TenantManagement/EntityFrameworkCore/AbpTenantManagementEntityFrameworkCoreModule.cs @@ -8,14 +8,14 @@ namespace Volo.Abp.TenantManagement.EntityFrameworkCore [DependsOn(typeof(AbpEntityFrameworkCoreModule))] public class AbpTenantManagementEntityFrameworkCoreModule : AbpModule { - public override void ConfigureServices(IServiceCollection services) + public override void ConfigureServices(ServiceConfigurationContext context) { - services.AddAbpDbContext(options => + context.Services.AddAbpDbContext(options => { options.AddDefaultRepositories(); }); - services.AddAssemblyOf(); + context.Services.AddAssemblyOf(); } } } diff --git a/modules/tenant-management/src/Volo.Abp.TenantManagement.HttpApi.Client/Volo/Abp/TenantManagement/AbpTenantManagementHttpApiClientModule.cs b/modules/tenant-management/src/Volo.Abp.TenantManagement.HttpApi.Client/Volo/Abp/TenantManagement/AbpTenantManagementHttpApiClientModule.cs index fec7399b3a..16232a2a86 100644 --- a/modules/tenant-management/src/Volo.Abp.TenantManagement.HttpApi.Client/Volo/Abp/TenantManagement/AbpTenantManagementHttpApiClientModule.cs +++ b/modules/tenant-management/src/Volo.Abp.TenantManagement.HttpApi.Client/Volo/Abp/TenantManagement/AbpTenantManagementHttpApiClientModule.cs @@ -11,14 +11,14 @@ namespace Volo.Abp.TenantManagement { public const string RemoteServiceName = "AbpTenantManagement"; - public override void ConfigureServices(IServiceCollection services) + public override void ConfigureServices(ServiceConfigurationContext context) { - services.AddHttpClientProxies( + context.Services.AddHttpClientProxies( typeof(AbpTenantManagementApplicationContractsModule).Assembly, RemoteServiceName ); - services.AddAssemblyOf(); + context.Services.AddAssemblyOf(); } } } \ No newline at end of file diff --git a/modules/tenant-management/src/Volo.Abp.TenantManagement.HttpApi/Volo/Abp/TenantManagement/AbpTenantManagementHttpApiModule.cs b/modules/tenant-management/src/Volo.Abp.TenantManagement.HttpApi/Volo/Abp/TenantManagement/AbpTenantManagementHttpApiModule.cs index 5e967e93f8..a0a2011799 100644 --- a/modules/tenant-management/src/Volo.Abp.TenantManagement.HttpApi/Volo/Abp/TenantManagement/AbpTenantManagementHttpApiModule.cs +++ b/modules/tenant-management/src/Volo.Abp.TenantManagement.HttpApi/Volo/Abp/TenantManagement/AbpTenantManagementHttpApiModule.cs @@ -10,9 +10,9 @@ namespace Volo.Abp.TenantManagement )] public class AbpTenantManagementHttpApiModule : AbpModule { - public override void ConfigureServices(IServiceCollection services) + public override void ConfigureServices(ServiceConfigurationContext context) { - services.AddAssemblyOf(); + context.Services.AddAssemblyOf(); } } } \ No newline at end of file diff --git a/modules/tenant-management/src/Volo.Abp.TenantManagement.MongoDB/Volo/Abp/TenantManagement/MongoDb/AbpTenantManagementMongoDbModule.cs b/modules/tenant-management/src/Volo.Abp.TenantManagement.MongoDB/Volo/Abp/TenantManagement/MongoDb/AbpTenantManagementMongoDbModule.cs index b34d77d0f6..457f2d88f3 100644 --- a/modules/tenant-management/src/Volo.Abp.TenantManagement.MongoDB/Volo/Abp/TenantManagement/MongoDb/AbpTenantManagementMongoDbModule.cs +++ b/modules/tenant-management/src/Volo.Abp.TenantManagement.MongoDB/Volo/Abp/TenantManagement/MongoDb/AbpTenantManagementMongoDbModule.cs @@ -10,18 +10,18 @@ namespace Volo.Abp.TenantManagement.MongoDb )] public class AbpTenantManagementMongoDbModule : AbpModule { - public override void ConfigureServices(IServiceCollection services) + public override void ConfigureServices(ServiceConfigurationContext context) { AbpTenantManagementBsonClassMap.Configure(); - services.AddMongoDbContext(options => + context.Services.AddMongoDbContext(options => { options.AddDefaultRepositories(); options.AddRepository(); }); - services.AddAssemblyOf(); + context.Services.AddAssemblyOf(); } } } diff --git a/modules/tenant-management/src/Volo.Abp.TenantManagement.Web/AbpTenantManagementWebModule.cs b/modules/tenant-management/src/Volo.Abp.TenantManagement.Web/AbpTenantManagementWebModule.cs index d5913f4bf0..774c9c05b6 100644 --- a/modules/tenant-management/src/Volo.Abp.TenantManagement.Web/AbpTenantManagementWebModule.cs +++ b/modules/tenant-management/src/Volo.Abp.TenantManagement.Web/AbpTenantManagementWebModule.cs @@ -19,27 +19,27 @@ namespace Volo.Abp.TenantManagement.Web [DependsOn(typeof(AbpAutoMapperModule))] public class AbpTenantManagementWebModule : AbpModule { - public override void PreConfigureServices(IServiceCollection services) + public override void PreConfigureServices(ServiceConfigurationContext context) { - services.PreConfigure(options => + context.Services.PreConfigure(options => { options.AddAssemblyResource(typeof(AbpTenantManagementResource), typeof(AbpTenantManagementWebModule).Assembly); }); } - public override void ConfigureServices(IServiceCollection services) + public override void ConfigureServices(ServiceConfigurationContext context) { - services.Configure(options => + context.Services.Configure(options => { options.MenuContributors.Add(new AbpTenantManagementWebMainMenuContributor()); }); - services.Configure(options => + context.Services.Configure(options => { options.FileSets.AddEmbedded("Volo.Abp.TenantManagement.Web"); }); - services.Configure(options => + context.Services.Configure(options => { options.Resources .Get() @@ -49,19 +49,19 @@ namespace Volo.Abp.TenantManagement.Web ).AddVirtualJson("/Localization/Resources/AbpTenantManagement/Web"); }); - services.Configure(options => + context.Services.Configure(options => { options.AddProfile(validate: true); }); - services.Configure(options => + context.Services.Configure(options => { options.Conventions.AuthorizePage("/TenantManagement/Tenants/Index", TenantManagementPermissions.Tenants.Default); options.Conventions.AuthorizePage("/TenantManagement/Tenants/CreateModal", TenantManagementPermissions.Tenants.Create); options.Conventions.AuthorizePage("/TenantManagement/Tenants/EditModal", TenantManagementPermissions.Tenants.Update); }); - services.AddAssemblyOf(); + context.Services.AddAssemblyOf(); } } } \ No newline at end of file diff --git a/modules/tenant-management/test/Volo.Abp.TenantManagement.Application.Tests/Volo/Abp/TenantManagement/AbpTenantManagementApplicationTestModule.cs b/modules/tenant-management/test/Volo.Abp.TenantManagement.Application.Tests/Volo/Abp/TenantManagement/AbpTenantManagementApplicationTestModule.cs index c8a9d0978d..862785df55 100644 --- a/modules/tenant-management/test/Volo.Abp.TenantManagement.Application.Tests/Volo/Abp/TenantManagement/AbpTenantManagementApplicationTestModule.cs +++ b/modules/tenant-management/test/Volo.Abp.TenantManagement.Application.Tests/Volo/Abp/TenantManagement/AbpTenantManagementApplicationTestModule.cs @@ -9,11 +9,11 @@ namespace Volo.Abp.TenantManagement typeof(AbpTenantManagementEntityFrameworkCoreTestModule))] public class AbpTenantManagementApplicationTestModule : AbpModule { - public override void ConfigureServices(IServiceCollection services) + public override void ConfigureServices(ServiceConfigurationContext context) { - services.AddAlwaysAllowPermissionChecker(); + context.Services.AddAlwaysAllowPermissionChecker(); - services.AddAssemblyOf(); + context.Services.AddAssemblyOf(); } } } diff --git a/modules/tenant-management/test/Volo.Abp.TenantManagement.EntityFrameworkCore.Tests/Volo/Abp/TenantManagement/EntityFrameworkCore/AbpTenantManagementEntityFrameworkCoreTestModule.cs b/modules/tenant-management/test/Volo.Abp.TenantManagement.EntityFrameworkCore.Tests/Volo/Abp/TenantManagement/EntityFrameworkCore/AbpTenantManagementEntityFrameworkCoreTestModule.cs index bcaad7dd9d..3795fab766 100644 --- a/modules/tenant-management/test/Volo.Abp.TenantManagement.EntityFrameworkCore.Tests/Volo/Abp/TenantManagement/EntityFrameworkCore/AbpTenantManagementEntityFrameworkCoreTestModule.cs +++ b/modules/tenant-management/test/Volo.Abp.TenantManagement.EntityFrameworkCore.Tests/Volo/Abp/TenantManagement/EntityFrameworkCore/AbpTenantManagementEntityFrameworkCoreTestModule.cs @@ -13,26 +13,26 @@ namespace Volo.Abp.TenantManagement.EntityFrameworkCore )] public class AbpTenantManagementEntityFrameworkCoreTestModule : AbpModule { - public override void ConfigureServices(IServiceCollection services) + public override void ConfigureServices(ServiceConfigurationContext context) { - services.AddEntityFrameworkInMemoryDatabase(); + context.Services.AddEntityFrameworkInMemoryDatabase(); var databaseName = Guid.NewGuid().ToString(); - services.Configure(options => + context.Services.Configure(options => { - options.Configure(context => + options.Configure(abpDbContextConfigurationContext => { - context.DbContextOptions.UseInMemoryDatabase(databaseName); + abpDbContextConfigurationContext.DbContextOptions.UseInMemoryDatabase(databaseName); }); }); - services.Configure(options => + context.Services.Configure(options => { options.TransactionBehavior = UnitOfWorkTransactionBehavior.Disabled; //EF in-memory database does not support transactions }); - services.AddAssemblyOf(); + context.Services.AddAssemblyOf(); } } } diff --git a/modules/tenant-management/test/Volo.Abp.TenantManagement.MongoDB.Tests/Volo/Abp/TenantManagement/MongoDb/AbpTenantManagementMongoDbTestModule.cs b/modules/tenant-management/test/Volo.Abp.TenantManagement.MongoDB.Tests/Volo/Abp/TenantManagement/MongoDb/AbpTenantManagementMongoDbTestModule.cs index f1534bb254..8aeec38738 100644 --- a/modules/tenant-management/test/Volo.Abp.TenantManagement.MongoDB.Tests/Volo/Abp/TenantManagement/MongoDb/AbpTenantManagementMongoDbTestModule.cs +++ b/modules/tenant-management/test/Volo.Abp.TenantManagement.MongoDB.Tests/Volo/Abp/TenantManagement/MongoDb/AbpTenantManagementMongoDbTestModule.cs @@ -13,16 +13,16 @@ namespace Volo.Abp.TenantManagement.MongoDb { private MongoDbRunner _mongoDbRunner; - public override void ConfigureServices(IServiceCollection services) + public override void ConfigureServices(ServiceConfigurationContext context) { _mongoDbRunner = MongoDbRunner.Start(); - services.Configure(options => + context.Services.Configure(options => { options.ConnectionStrings.Default = _mongoDbRunner.ConnectionString; }); - services.AddAssemblyOf(); + context.Services.AddAssemblyOf(); } public override void OnApplicationShutdown(ApplicationShutdownContext context) diff --git a/modules/tenant-management/test/Volo.Abp.TenantManagement.TestBase/Volo/Abp/TenantManagement/AbpTenantManagementTestBaseModule.cs b/modules/tenant-management/test/Volo.Abp.TenantManagement.TestBase/Volo/Abp/TenantManagement/AbpTenantManagementTestBaseModule.cs index b2275b9d10..a2abbb84ce 100644 --- a/modules/tenant-management/test/Volo.Abp.TenantManagement.TestBase/Volo/Abp/TenantManagement/AbpTenantManagementTestBaseModule.cs +++ b/modules/tenant-management/test/Volo.Abp.TenantManagement.TestBase/Volo/Abp/TenantManagement/AbpTenantManagementTestBaseModule.cs @@ -11,9 +11,9 @@ namespace Volo.Abp.TenantManagement )] public class AbpTenantManagementTestBaseModule : AbpModule { - public override void ConfigureServices(IServiceCollection services) + public override void ConfigureServices(ServiceConfigurationContext context) { - services.AddAssemblyOf(); + context.Services.AddAssemblyOf(); } public override void OnApplicationInitialization(ApplicationInitializationContext context) diff --git a/modules/users/src/Volo.Abp.Users.Abstractions/Volo/Abp/Users/AbpUsersAbstractionModule.cs b/modules/users/src/Volo.Abp.Users.Abstractions/Volo/Abp/Users/AbpUsersAbstractionModule.cs index 6b66444d32..d819bcc47d 100644 --- a/modules/users/src/Volo.Abp.Users.Abstractions/Volo/Abp/Users/AbpUsersAbstractionModule.cs +++ b/modules/users/src/Volo.Abp.Users.Abstractions/Volo/Abp/Users/AbpUsersAbstractionModule.cs @@ -8,14 +8,14 @@ namespace Volo.Abp.Users public class AbpUsersAbstractionModule : AbpModule { - public override void ConfigureServices(IServiceCollection services) + public override void ConfigureServices(ServiceConfigurationContext context) { - services.Configure(options => + context.Services.Configure(options => { options.ValueProviders.Add(); }); - services.AddAssemblyOf(); + context.Services.AddAssemblyOf(); } } } diff --git a/modules/users/src/Volo.Abp.Users.Domain.Shared/Volo/Abp/Users/AbpUsersDomainSharedModule.cs b/modules/users/src/Volo.Abp.Users.Domain.Shared/Volo/Abp/Users/AbpUsersDomainSharedModule.cs index 7a8984bbb3..5cf6067af8 100644 --- a/modules/users/src/Volo.Abp.Users.Domain.Shared/Volo/Abp/Users/AbpUsersDomainSharedModule.cs +++ b/modules/users/src/Volo.Abp.Users.Domain.Shared/Volo/Abp/Users/AbpUsersDomainSharedModule.cs @@ -5,9 +5,9 @@ namespace Volo.Abp.Users { public class AbpUsersDomainSharedModule : AbpModule { - public override void ConfigureServices(IServiceCollection services) + public override void ConfigureServices(ServiceConfigurationContext context) { - services.AddAssemblyOf(); + context.Services.AddAssemblyOf(); } } } diff --git a/modules/users/src/Volo.Abp.Users.Domain/Volo/Abp/Users/AbpUsersDomainModule.cs b/modules/users/src/Volo.Abp.Users.Domain/Volo/Abp/Users/AbpUsersDomainModule.cs index d0fe88111b..b3c11e0cdd 100644 --- a/modules/users/src/Volo.Abp.Users.Domain/Volo/Abp/Users/AbpUsersDomainModule.cs +++ b/modules/users/src/Volo.Abp.Users.Domain/Volo/Abp/Users/AbpUsersDomainModule.cs @@ -13,9 +13,9 @@ namespace Volo.Abp.Users )] public class AbpUsersDomainModule : AbpModule { - public override void ConfigureServices(IServiceCollection services) + public override void ConfigureServices(ServiceConfigurationContext context) { - services.AddAssemblyOf(); + context.Services.AddAssemblyOf(); } } } diff --git a/modules/users/src/Volo.Abp.Users.EntityFrameworkCore/Volo/Abp/Users/EntityFrameworkCore/AbpUsersEntityFrameworkCoreModule.cs b/modules/users/src/Volo.Abp.Users.EntityFrameworkCore/Volo/Abp/Users/EntityFrameworkCore/AbpUsersEntityFrameworkCoreModule.cs index 375a42ea66..e4e4cf56f4 100644 --- a/modules/users/src/Volo.Abp.Users.EntityFrameworkCore/Volo/Abp/Users/EntityFrameworkCore/AbpUsersEntityFrameworkCoreModule.cs +++ b/modules/users/src/Volo.Abp.Users.EntityFrameworkCore/Volo/Abp/Users/EntityFrameworkCore/AbpUsersEntityFrameworkCoreModule.cs @@ -10,9 +10,9 @@ namespace Volo.Abp.Users.EntityFrameworkCore )] public class AbpUsersEntityFrameworkCoreModule : AbpModule { - public override void ConfigureServices(IServiceCollection services) + public override void ConfigureServices(ServiceConfigurationContext context) { - services.AddAssemblyOf(); + context.Services.AddAssemblyOf(); } } } diff --git a/modules/users/src/Volo.Abp.Users.MongoDB/Volo/Abp/Users/MongoDB/AbpUsersMongoDbModule.cs b/modules/users/src/Volo.Abp.Users.MongoDB/Volo/Abp/Users/MongoDB/AbpUsersMongoDbModule.cs index ef10cc9e76..7d452f157c 100644 --- a/modules/users/src/Volo.Abp.Users.MongoDB/Volo/Abp/Users/MongoDB/AbpUsersMongoDbModule.cs +++ b/modules/users/src/Volo.Abp.Users.MongoDB/Volo/Abp/Users/MongoDB/AbpUsersMongoDbModule.cs @@ -10,9 +10,9 @@ namespace Volo.Abp.Users.MongoDB )] public class AbpUsersMongoDbModule : AbpModule { - public override void ConfigureServices(IServiceCollection services) + public override void ConfigureServices(ServiceConfigurationContext context) { - services.AddAssemblyOf(); + context.Services.AddAssemblyOf(); } } } diff --git a/templates/mvc/src/MyCompanyName.MyProjectName.Application/MyProjectNameApplicationModule.cs b/templates/mvc/src/MyCompanyName.MyProjectName.Application/MyProjectNameApplicationModule.cs index 65faecfaa4..83360a1773 100644 --- a/templates/mvc/src/MyCompanyName.MyProjectName.Application/MyProjectNameApplicationModule.cs +++ b/templates/mvc/src/MyCompanyName.MyProjectName.Application/MyProjectNameApplicationModule.cs @@ -12,19 +12,19 @@ namespace MyCompanyName.MyProjectName typeof(AbpIdentityApplicationModule))] public class MyProjectNameApplicationModule : AbpModule { - public override void ConfigureServices(IServiceCollection services) + public override void ConfigureServices(ServiceConfigurationContext context) { - services.Configure(options => + context.Services.Configure(options => { options.DefinitionProviders.Add(); }); - services.Configure(options => + context.Services.Configure(options => { options.AddProfile(); }); - services.AddAssemblyOf(); + context.Services.AddAssemblyOf(); } } } diff --git a/templates/mvc/src/MyCompanyName.MyProjectName.Domain/MyProjectNameDomainModule.cs b/templates/mvc/src/MyCompanyName.MyProjectName.Domain/MyProjectNameDomainModule.cs index f867befd4c..24c04cff1c 100644 --- a/templates/mvc/src/MyCompanyName.MyProjectName.Domain/MyProjectNameDomainModule.cs +++ b/templates/mvc/src/MyCompanyName.MyProjectName.Domain/MyProjectNameDomainModule.cs @@ -13,14 +13,14 @@ namespace MyCompanyName.MyProjectName [DependsOn(typeof(AbpIdentityDomainModule))] public class MyProjectNameDomainModule : AbpModule { - public override void ConfigureServices(IServiceCollection services) + public override void ConfigureServices(ServiceConfigurationContext context) { - services.Configure(options => + context.Services.Configure(options => { options.FileSets.AddEmbedded(); }); - services.Configure(options => + context.Services.Configure(options => { options.Resources .Add("en") @@ -28,12 +28,12 @@ namespace MyCompanyName.MyProjectName .AddVirtualJson("/Localization/MyProjectName"); }); - services.Configure(options => + context.Services.Configure(options => { options.DefinitionProviders.Add(); }); - services.AddAssemblyOf(); + context.Services.AddAssemblyOf(); } } } diff --git a/templates/mvc/src/MyCompanyName.MyProjectName.EntityFrameworkCore/EntityFrameworkCore/MyProjectNameEntityFrameworkCoreModule.cs b/templates/mvc/src/MyCompanyName.MyProjectName.EntityFrameworkCore/EntityFrameworkCore/MyProjectNameEntityFrameworkCoreModule.cs index 9934b558e6..8615c645bf 100644 --- a/templates/mvc/src/MyCompanyName.MyProjectName.EntityFrameworkCore/EntityFrameworkCore/MyProjectNameEntityFrameworkCoreModule.cs +++ b/templates/mvc/src/MyCompanyName.MyProjectName.EntityFrameworkCore/EntityFrameworkCore/MyProjectNameEntityFrameworkCoreModule.cs @@ -15,14 +15,14 @@ namespace MyCompanyName.MyProjectName.EntityFrameworkCore typeof(AbpEntityFrameworkCoreSqlServerModule))] public class MyProjectNameEntityFrameworkCoreModule : AbpModule { - public override void ConfigureServices(IServiceCollection services) + public override void ConfigureServices(ServiceConfigurationContext context) { - services.AddAbpDbContext(options => + context.Services.AddAbpDbContext(options => { options.AddDefaultRepositories(); }); - services.AddAssemblyOf(); + context.Services.AddAssemblyOf(); } } } diff --git a/templates/mvc/src/MyCompanyName.MyProjectName.Web/MyProjectNameWebModule.cs b/templates/mvc/src/MyCompanyName.MyProjectName.Web/MyProjectNameWebModule.cs index 608a47f6f2..36e92b3b30 100644 --- a/templates/mvc/src/MyCompanyName.MyProjectName.Web/MyProjectNameWebModule.cs +++ b/templates/mvc/src/MyCompanyName.MyProjectName.Web/MyProjectNameWebModule.cs @@ -48,9 +48,9 @@ namespace MyCompanyName.MyProjectName )] public class MyProjectNameWebModule : AbpModule { - public override void PreConfigureServices(IServiceCollection services) + public override void PreConfigureServices(ServiceConfigurationContext context) { - services.PreConfigure(options => + context.Services.PreConfigure(options => { options.AddAssemblyResource( typeof(MyProjectNameResource), @@ -61,20 +61,20 @@ namespace MyCompanyName.MyProjectName }); } - public override void ConfigureServices(IServiceCollection services) + public override void ConfigureServices(ServiceConfigurationContext context) { - var hostingEnvironment = services.GetHostingEnvironment(); - var configuration = services.BuildConfiguration(); - - ConfigureDatabaseServices(services, configuration); - ConfigureAutoMapper(services); - ConfigureVirtualFileSystem(services, hostingEnvironment); - ConfigureLocalizationServices(services); - ConfigureNavigationServices(services); - ConfigureAutoApiControllers(services); - ConfigureSwaggerServices(services); - - services.AddAssemblyOf(); + var hostingEnvironment = context.Services.GetHostingEnvironment(); + var configuration = context.Services.BuildConfiguration(); + + ConfigureDatabaseServices(context.Services, configuration); + ConfigureAutoMapper(context.Services); + ConfigureVirtualFileSystem(context.Services, hostingEnvironment); + ConfigureLocalizationServices(context.Services); + ConfigureNavigationServices(context.Services); + ConfigureAutoApiControllers(context.Services); + ConfigureSwaggerServices(context.Services); + + context.Services.AddAssemblyOf(); } private static void ConfigureDatabaseServices(IServiceCollection services, IConfigurationRoot configuration) diff --git a/templates/mvc/test/MyCompanyName.MyProjectName.Application.Tests/MyProjectNameApplicationTestModule.cs b/templates/mvc/test/MyCompanyName.MyProjectName.Application.Tests/MyProjectNameApplicationTestModule.cs index 065dac4503..d940e8214f 100644 --- a/templates/mvc/test/MyCompanyName.MyProjectName.Application.Tests/MyProjectNameApplicationTestModule.cs +++ b/templates/mvc/test/MyCompanyName.MyProjectName.Application.Tests/MyProjectNameApplicationTestModule.cs @@ -21,13 +21,13 @@ namespace MyCompanyName.MyProjectName { private SqliteConnection _sqliteConnection; - public override void ConfigureServices(IServiceCollection services) + public override void ConfigureServices(ServiceConfigurationContext context) { - services.AddAlwaysAllowAuthorization(); + context.Services.AddAlwaysAllowAuthorization(); - ConfigureInMemorySqlite(services); + ConfigureInMemorySqlite(context.Services); - services.AddAssemblyOf(); + context.Services.AddAssemblyOf(); } private void ConfigureInMemorySqlite(IServiceCollection services) diff --git a/templates/mvc/test/MyCompanyName.MyProjectName.Web.Tests/MyProjectNameWebTestModule.cs b/templates/mvc/test/MyCompanyName.MyProjectName.Web.Tests/MyProjectNameWebTestModule.cs index e4df06c907..d071c19a15 100644 --- a/templates/mvc/test/MyCompanyName.MyProjectName.Web.Tests/MyProjectNameWebTestModule.cs +++ b/templates/mvc/test/MyCompanyName.MyProjectName.Web.Tests/MyProjectNameWebTestModule.cs @@ -32,20 +32,20 @@ namespace MyCompanyName.MyProjectName )] public class MyProjectNameWebTestModule : AbpModule { - public override void PreConfigureServices(IServiceCollection services) + public override void PreConfigureServices(ServiceConfigurationContext context) { - services.PreConfigure(builder => + context.Services.PreConfigure(builder => { builder.PartManager.ApplicationParts.Add(new AssemblyPart(typeof(MyProjectNameWebModule).Assembly)); }); } - public override void ConfigureServices(IServiceCollection services) + public override void ConfigureServices(ServiceConfigurationContext context) { - ConfigureLocalizationServices(services); - ConfigureNavigationServices(services); + ConfigureLocalizationServices(context.Services); + ConfigureNavigationServices(context.Services); - services.AddAssemblyOf(); + context.Services.AddAssemblyOf(); } private static void ConfigureLocalizationServices(IServiceCollection services)