diff --git a/docs/Dependency-Injection.md b/docs/Dependency-Injection.md index 15c9fe941d..5839b71dc0 100644 --- a/docs/Dependency-Injection.md +++ b/docs/Dependency-Injection.md @@ -18,11 +18,28 @@ public class BlogModule : AbpModule ### Conventional Registration -ABP introduces conventional service registration. To register all services of a module, you can simple call ``AddAssemblyOf`` extension method as shown below: +ABP introduces conventional service registration. You should do nothing to register services by convention. It's automatically done. If you want to disable it, you can set `SkipAutoServiceRegistration` to `true` by overriding the `PreConfigureServices` method. ````C# public class BlogModule : AbpModule { + public override void PreConfigureServices(ServiceConfigurationContext context) + { + SkipAutoServiceRegistration = true; + } +} +```` + +Once you skip auto registration, you should manually register your services. In that case, ``AddAssemblyOf`` extension method can help you to register all your services by convention. Example: + +````c# +public class BlogModule : AbpModule +{ + public override void PreConfigureServices(ServiceConfigurationContext context) + { + SkipAutoServiceRegistration = true; + } + public override void ConfigureServices(ServiceConfigurationContext context) { context.Services.AddAssemblyOf(); @@ -30,19 +47,19 @@ public class BlogModule : AbpModule } ```` -``AddAssemblyOf`` extension method takes a type (generally the type of the module class) and registers all services in the same assembly with given type by convention. The section below explains conventions and configurations. +The section below explains the conventions and configurations. -#### Inheritly Registered Types +#### Inherently Registered Types Some specific types are registered to dependency injection by default. Examples: -* Module classes implement ``IAbpModule`` interface are registered as singleton. -* MVC controllers inherit ``Controller`` (or ``AbpController``) class are registered as transient. -* MVC page models inherit ``PageModel`` (or ``AbpPageModel``) class are registered as transient. -* MVC view components inherit ``ViewComponent`` (or ``AbpViewComponent``) class are registered as transient. -* Application services implement ``IApplicationService`` interface (or inherit ``ApplicationService`` class) are registered as transient. -* Repositories implement ``IRepository`` interface are registered as transient. -* Domain services implement ``IDomainService`` interface are registered as transient. +* Module classes are registered as singleton. +* MVC controllers (inherit ``Controller`` or ``AbpController``) are registered as transient. +* MVC page models (inherit ``PageModel`` or ``AbpPageModel``) are registered as transient. +* MVC view components (inherit ``ViewComponent`` or ``AbpViewComponent``) are registered as transient. +* Application services (implement ``IApplicationService`` interface or inherit ``ApplicationService`` class) are registered as transient. +* Repositories (implement ``IRepository`` interface) are registered as transient. +* Domain services (implement ``IDomainService`` interface) are registered as transient. Example: @@ -129,16 +146,13 @@ public class TaxCalculator : ITaxCalculator, ITransientDependency #### Manually Registering -In some cases, you may need to register a service to IServiceCollection manually, especially if you need to use custom factory methods or singleton instances. In that case, you can directly add services just as Microsoft documentation describes. Example: +In some cases, you may need to register a service to the `IServiceCollection` manually, especially if you need to use custom factory methods or singleton instances. In that case, you can directly add services just as Microsoft documentation describes. Example: ````C# public class BlogModule : AbpModule { public override void ConfigureServices(ServiceConfigurationContext context) { - //Add services by convention - context.Services.AddAssemblyOf(); - //Register an instance as singleton context.Services.AddSingleton(new TaxCalculator(taxRatio: 0.18)); @@ -148,25 +162,6 @@ public class BlogModule : AbpModule } ```` -Finally, you may want to add a single class or a few classes by ABP's conventions, but don't want to use ``AddAssemblyOf``. In that case, you can use ``AddType`` and ``AddTypes`` extension method which implements ABP's conventions for given type(s). Example: - -````C# -public class BlogModule : AbpModule -{ - public override void ConfigureServices(ServiceConfigurationContext context) - { - //Add single type - context.Services.AddType(typeof(TaxCalculator)); - - //Add multiple types in once call - context.Services.AddTypes(typeof(TaxCalculator), typeof(MyOtherService)); - - //Add single type using generic shortcut - context.Services.AddType(); - } -} -```` - ### Injecting Dependencies There are three common ways of using a service that is registered before. @@ -269,4 +264,8 @@ using (var scope = _serviceProvider.CreateScope()) } ```` -Both services are released when the created scope is disposed (at the end of the using block). \ No newline at end of file +Both services are released when the created scope is disposed (at the end of the using block). + +### See Also + +* [ASP.NET Core Dependency Injection Best Practices, Tips & Tricks](https://medium.com/volosoft/asp-net-core-dependency-injection-best-practices-tips-tricks-c6e9c67f9d96) \ No newline at end of file diff --git a/docs/Getting-Started-AspNetCore-Application.md b/docs/Getting-Started-AspNetCore-Application.md index 30d956c53c..f63040a6e1 100644 --- a/docs/Getting-Started-AspNetCore-Application.md +++ b/docs/Getting-Started-AspNetCore-Application.md @@ -1,6 +1,6 @@ ## Getting Started ABP With AspNet Core MVC Web Application -This tutorial explains how to start ABP from scratch with minimal dependencies. You generally want to start with a ***startup template*** (TODO: link). +This tutorial explains how to start ABP from scratch with minimal dependencies. You generally want to start with a ***[startup template](https://abp.io/Templates)***. ### Create A New Project @@ -40,11 +40,6 @@ namespace BasicAspNetCoreApplication [DependsOn(typeof(AbpAspNetCoreMvcModule))] public class AppModule : AbpModule { - public override void ConfigureServices(ServiceConfigurationContext context) - { - context.Services.AddAssemblyOf(); - } - public override void OnApplicationInitialization(ApplicationInitializationContext context) { var app = context.GetApplicationBuilder(); @@ -63,11 +58,9 @@ namespace BasicAspNetCoreApplication ``AppModule`` is a good name for the startup module for an application. -A module class can register services to Dependency Injection by overriding ``ConfigureServices`` method as shown here. ``AddAssemblyOf<...>`` is a special extension method of ABP that registers all services in an assembly by convention (see [dependency injection document](Dependency-Injection.md)). While this is optional, a module generally registers some services. - ABP packages define module classes and a module can depend on another module. In the code above, our ``AppModule`` depends on ``AbpAspNetCoreMvcModule`` (defined by Volo.Abp.AspNetCore.Mvc package). It's common to add a ``DependsOn`` attribute after installing a new ABP nuget package. -Instead of Startup class, we are registering dependencies and configuring AspNet Core pipeline in this module class. +Instead of Startup class, we are configuring ASP.NET Core pipeline in this module class. ### The Startup Class @@ -127,7 +120,7 @@ If you run the application, you will see a "Hello World!" message on the page. Derived ``HomeController`` from ``AbpController`` instead of standard ``Controller`` class. This is not required, but ``AbpController`` class has useful base properties and methods to make your development easier. -### Using Autofac as Dependency Injection Framework +### Using Autofac as the Dependency Injection Framework While AspNet Core's Dependency Injection (DI) system is fine for basic requirements, Autofac provides advanced features like Property Injection and Method Interception which are required by ABP to perform advanced application framework features. diff --git a/docs/Getting-Started-Console-Application.md b/docs/Getting-Started-Console-Application.md index 2fdebd4356..0f10c7f505 100644 --- a/docs/Getting-Started-Console-Application.md +++ b/docs/Getting-Started-Console-Application.md @@ -1,6 +1,6 @@ ## Getting Started ABP With Console Application -This tutorial explains how to start ABP from scratch with minimal dependencies. You generally want to start with a ***startup template*** (TODO: link). +This tutorial explains how to start ABP from scratch with minimal dependencies. You generally want to start with a ***[startup template](https://abp.io/Templates)***. ### Create A New Project @@ -28,18 +28,13 @@ namespace AbpConsoleDemo { public class AppModule : AbpModule { - public override void ConfigureServices(ServiceConfigurationContext context) - { - context.Services.AddAssemblyOf(); - } + } } ```` ``AppModule`` is a good name for the startup module for an application. -A module class can register services to Dependency Injection by overriding ``ConfigureServices`` method as shown here. ``AddAssemblyOf<...>`` is a special extension method of ABP that registers all services in an assembly by convention (TODO: link to DI document). While this is optional, a module generally registers some services. - ### Initialize The Application The next step is to bootstrap the application using the startup module created above: @@ -110,7 +105,8 @@ namespace AbpConsoleDemo application.Initialize(); //Resolve a service and use it - var helloWorldService = application.ServiceProvider.GetService(); + var helloWorldService = + application.ServiceProvider.GetService(); helloWorldService.SayHello(); Console.WriteLine("Press ENTER to stop application..."); diff --git a/docs/Module-Development-Basics.md b/docs/Module-Development-Basics.md index 151bd9987a..43435ef080 100644 --- a/docs/Module-Development-Basics.md +++ b/docs/Module-Development-Basics.md @@ -32,19 +32,7 @@ public class BlogModule : AbpModule } ```` -You can register dependencies one by one as stated in Microsoft's documentation. ABP has also a **conventional dependency registration system** which allows you to register all services in your assembly automatically. ``ConfigureServices`` methods of most modules contain such an expression to register all services in given module: - -````C# -public class BlogModule : AbpModule -{ - public override void ConfigureServices(ServiceConfigurationContext context) - { - context.Services.AddAssemblyOf(); - } -} -```` - -See [Dependency Injection](Dependency-Injection.md) documentation for more about the dependency injection system. +You can register dependencies one by one as stated in Microsoft's documentation. Bu ABP has a **conventional dependency registration system** which automatically register all services in your assembly. See the [dependency Injection](Dependency-Injection.md) documentation for more about the dependency injection system. You can also configure other services and modules in this method. Example: @@ -53,8 +41,6 @@ public class BlogModule : AbpModule { public override void ConfigureServices(ServiceConfigurationContext context) { - context.Services.AddAssemblyOf(); - //Configure default connection string for the application context.Services.Configure(options => { @@ -124,19 +110,6 @@ You can also perform startup logic if your module requires Lastly, you can override ``OnApplicationShutdown`` method if you want to execute a code while application is beign shutdown. -#### Alternative to Deriving from AbpModule Class - -If you want to not derive your modules from ``AbpModule`` class for some reason, you can create a class and implement ``IAbpModule`` interface. This is the minimal interface required by ABP. If you want to handle other life cycle events as described above, you can implement additional interfaces: - -* ``IPreConfigureServices`` -* ``IPostConfigureServices`` -* ``IOnPreApplicationInitialization`` -* ``IOnApplicationInitialization`` -* ``IOnPostApplicationInitialization`` -* ``IOnApplicationShutdown`` - -However, deriving from ``AbpModule`` class is simpler since it implements all of these interfaces as virtual empty methods, so you can simple override which you need. - ### Module Dependencies In a modular application, it's typical a module depends on other modules. An Abp module must declare ``[DependsOn]`` attribute if it depends on another module, as shown below: 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 03caf3b86e..cff3f437b7 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 @@ -1,5 +1,4 @@ -using Microsoft.Extensions.DependencyInjection; -using Volo.Abp.Modularity; +using Volo.Abp.Modularity; using Volo.Abp.Security; namespace Volo.Abp.AspNetCore.Authentication.OAuth @@ -7,9 +6,6 @@ namespace Volo.Abp.AspNetCore.Authentication.OAuth [DependsOn(typeof(AbpSecurityModule))] public class AbpAspNetCoreAuthenticationOAuthModule : AbpModule { - public override void ConfigureServices(ServiceConfigurationContext context) - { - 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 99dec58953..bb9d7bac7c 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 @@ -19,8 +19,6 @@ namespace Volo.Abp.AspNetCore.MultiTenancy options.TenantResolvers.Add(new HeaderTenantResolveContributer()); options.TenantResolvers.Add(new CookieTenantResolveContributer()); }); - - 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 213a22296f..bc0171a7d5 100644 --- a/framework/src/Volo.Abp.AspNetCore.Mvc.UI.Bootstrap/AbpAspNetCoreMvcUiBootstrapModule.cs +++ b/framework/src/Volo.Abp.AspNetCore.Mvc.UI.Bootstrap/AbpAspNetCoreMvcUiBootstrapModule.cs @@ -9,8 +9,6 @@ namespace Volo.Abp.AspNetCore.Mvc.UI.Bootstrap { public override void ConfigureServices(ServiceConfigurationContext context) { - context.Services.AddAssemblyOf(); - 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 920f70534d..714a7aa68b 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,6 @@ namespace Volo.Abp.AspNetCore.Mvc.UI.Bundling [DependsOn(typeof(AbpAspNetCoreMvcUiBootstrapModule))] public class AbpAspNetCoreMvcUiBundlingModule : AbpModule { - public override void ConfigureServices(ServiceConfigurationContext context) - { - 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 ea58b8c457..bab248f669 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,6 @@ namespace Volo.Abp.AspNetCore.Mvc.UI.Packages [DependsOn(typeof(AbpAspNetCoreMvcUiBundlingModule))] public class AbpAspNetCoreMvcUiPackagesModule : AbpModule { - public override void ConfigureServices(ServiceConfigurationContext context) - { - 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 0801850971..3cbb2d1030 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 @@ -56,8 +56,6 @@ namespace Volo.Abp.AspNetCore.Mvc.UI.Theme.Basic bundle.AddBaseBundles(StandardBundles.Scripts.Global); }); }); - - 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 efd99d93ff..4cf742b699 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 @@ -31,8 +31,6 @@ namespace Volo.Abp.AspNetCore.Mvc.UI.Theme.Shared .ScriptBundles .Add(StandardBundles.Scripts.Global, bundle => bundle.AddContributors(typeof(SharedThemeGlobalScriptContributor))); }); - - 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 5ea2b7ddb7..cafc4c87fc 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 @@ -1,5 +1,4 @@ -using Microsoft.Extensions.DependencyInjection; -using Volo.Abp.Modularity; +using Volo.Abp.Modularity; using Volo.Abp.UI.Navigation; namespace Volo.Abp.AspNetCore.Mvc.UI @@ -8,9 +7,6 @@ namespace Volo.Abp.AspNetCore.Mvc.UI [DependsOn(typeof(AbpUiNavigationModule))] public class AbpAspNetCoreMvcUiModule : AbpModule { - public override void ConfigureServices(ServiceConfigurationContext context) - { - 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 dad0076a53..f9a07ac3a4 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 @@ -109,8 +109,6 @@ namespace Volo.Abp.AspNetCore.Mvc { mvcOptions.AddAbp(context.Services); }); - - 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 3f9fd65b0a..28ec214ad2 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 @@ -1,5 +1,4 @@ -using Microsoft.Extensions.DependencyInjection; -using Volo.Abp.Http.Client; +using Volo.Abp.Http.Client; using Volo.Abp.Modularity; namespace Volo.Abp.AspNetCore.TestBase @@ -8,9 +7,6 @@ namespace Volo.Abp.AspNetCore.TestBase [DependsOn(typeof(AbpAspNetCoreModule))] public class AbpAspNetCoreTestBaseModule : AbpModule { - public override void ConfigureServices(ServiceConfigurationContext context) - { - 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 da59f2fef2..217691b909 100644 --- a/framework/src/Volo.Abp.AspNetCore/Volo/Abp/AspNetCore/AbpAspNetCoreModule.cs +++ b/framework/src/Volo.Abp.AspNetCore/Volo/Abp/AspNetCore/AbpAspNetCoreModule.cs @@ -39,7 +39,6 @@ namespace Volo.Abp.AspNetCore AddAspNetServices(context.Services); context.Services.AddObjectAccessor(); context.Services.AddConfiguration(); - 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 f76ba425ae..ed048f3d6a 100644 --- a/framework/src/Volo.Abp.Auditing/Volo/Abp/Auditing/AbpAuditingModule.cs +++ b/framework/src/Volo.Abp.Auditing/Volo/Abp/Auditing/AbpAuditingModule.cs @@ -23,10 +23,5 @@ namespace Volo.Abp.Auditing { context.Services.OnRegistred(AuditingInterceptorRegistrar.RegisterIfNeeded); } - - public override void ConfigureServices(ServiceConfigurationContext context) - { - 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 5d98925336..51150244e7 100644 --- a/framework/src/Volo.Abp.Authorization/Volo/Abp/Authorization/AbpAuthorizationModule.cs +++ b/framework/src/Volo.Abp.Authorization/Volo/Abp/Authorization/AbpAuthorizationModule.cs @@ -29,8 +29,6 @@ namespace Volo.Abp.Authorization options.ValueProviders.Add(); options.ValueProviders.Add(); }); - - 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 7eb61603b2..2e8c10bad0 100644 --- a/framework/src/Volo.Abp.AutoMapper/Volo/Abp/AutoMapper/AbpAutoMapperModule.cs +++ b/framework/src/Volo.Abp.AutoMapper/Volo/Abp/AutoMapper/AbpAutoMapperModule.cs @@ -19,8 +19,6 @@ namespace Volo.Abp.AutoMapper public override void ConfigureServices(ServiceConfigurationContext context) { - context.Services.AddAssemblyOf(); - var mapperAccessor = new MapperAccessor(); context.Services.AddSingleton(_ => mapperAccessor); context.Services.AddSingleton(_ => mapperAccessor); diff --git a/framework/src/Volo.Abp.BackgroundJobs.Abstractions/Volo/Abp/BackgroundJobs/AbpBackgroundJobsAbstractionsModule.cs b/framework/src/Volo.Abp.BackgroundJobs.Abstractions/Volo/Abp/BackgroundJobs/AbpBackgroundJobsAbstractionsModule.cs index 0c38a60766..224c9b1d2c 100644 --- a/framework/src/Volo.Abp.BackgroundJobs.Abstractions/Volo/Abp/BackgroundJobs/AbpBackgroundJobsAbstractionsModule.cs +++ b/framework/src/Volo.Abp.BackgroundJobs.Abstractions/Volo/Abp/BackgroundJobs/AbpBackgroundJobsAbstractionsModule.cs @@ -17,11 +17,6 @@ namespace Volo.Abp.BackgroundJobs RegisterJobs(context.Services); } - public override void ConfigureServices(ServiceConfigurationContext context) - { - context.Services.AddAssemblyOf(); - } - private static void RegisterJobs(IServiceCollection services) { var jobTypes = new List(); diff --git a/framework/src/Volo.Abp.BackgroundJobs.HangFire/Volo/Abp/BackgroundJobs/Hangfire/AbpBackgroundJobsHangfireModule.cs b/framework/src/Volo.Abp.BackgroundJobs.HangFire/Volo/Abp/BackgroundJobs/Hangfire/AbpBackgroundJobsHangfireModule.cs index b20e5877a4..066dccc28f 100644 --- a/framework/src/Volo.Abp.BackgroundJobs.HangFire/Volo/Abp/BackgroundJobs/Hangfire/AbpBackgroundJobsHangfireModule.cs +++ b/framework/src/Volo.Abp.BackgroundJobs.HangFire/Volo/Abp/BackgroundJobs/Hangfire/AbpBackgroundJobsHangfireModule.cs @@ -1,5 +1,4 @@ -using Microsoft.Extensions.DependencyInjection; -using Volo.Abp.Hangfire; +using Volo.Abp.Hangfire; using Volo.Abp.Modularity; namespace Volo.Abp.BackgroundJobs.Hangfire @@ -10,9 +9,6 @@ namespace Volo.Abp.BackgroundJobs.Hangfire )] public class AbpBackgroundJobsHangfireModule : AbpModule { - public override void ConfigureServices(ServiceConfigurationContext context) - { - context.Services.AddAssemblyOf(); - } + } } diff --git a/framework/src/Volo.Abp.BackgroundJobs.RabbitMQ/Volo/Abp/BackgroundJobs/RabbitMQ/AbpBackgroundJobsRabbitMqModule.cs b/framework/src/Volo.Abp.BackgroundJobs.RabbitMQ/Volo/Abp/BackgroundJobs/RabbitMQ/AbpBackgroundJobsRabbitMqModule.cs index 62ba464b0a..da18cdc8f3 100644 --- a/framework/src/Volo.Abp.BackgroundJobs.RabbitMQ/Volo/Abp/BackgroundJobs/RabbitMQ/AbpBackgroundJobsRabbitMqModule.cs +++ b/framework/src/Volo.Abp.BackgroundJobs.RabbitMQ/Volo/Abp/BackgroundJobs/RabbitMQ/AbpBackgroundJobsRabbitMqModule.cs @@ -15,8 +15,6 @@ namespace Volo.Abp.BackgroundJobs.RabbitMQ public override void ConfigureServices(ServiceConfigurationContext context) { context.Services.AddSingleton(typeof(IJobQueue<>), typeof(JobQueue<>)); - - context.Services.AddAssemblyOf(); } public override void OnApplicationInitialization(ApplicationInitializationContext context) diff --git a/framework/src/Volo.Abp.BackgroundJobs/Volo/Abp/BackgroundJobs/AbpBackgroundJobsModule.cs b/framework/src/Volo.Abp.BackgroundJobs/Volo/Abp/BackgroundJobs/AbpBackgroundJobsModule.cs index ea405068bb..f0324a9932 100644 --- a/framework/src/Volo.Abp.BackgroundJobs/Volo/Abp/BackgroundJobs/AbpBackgroundJobsModule.cs +++ b/framework/src/Volo.Abp.BackgroundJobs/Volo/Abp/BackgroundJobs/AbpBackgroundJobsModule.cs @@ -15,11 +15,6 @@ namespace Volo.Abp.BackgroundJobs )] public class AbpBackgroundJobsModule : AbpModule { - public override void ConfigureServices(ServiceConfigurationContext context) - { - context.Services.AddAssemblyOf(); - } - public override void OnApplicationInitialization(ApplicationInitializationContext context) { var options = context.ServiceProvider.GetRequiredService>().Value; diff --git a/framework/src/Volo.Abp.BackgroundWorkers/Volo/Abp/BackgroundWorkers/AbpBackgroundWorkersModule.cs b/framework/src/Volo.Abp.BackgroundWorkers/Volo/Abp/BackgroundWorkers/AbpBackgroundWorkersModule.cs index 8d4f94e90c..cae652ad28 100644 --- a/framework/src/Volo.Abp.BackgroundWorkers/Volo/Abp/BackgroundWorkers/AbpBackgroundWorkersModule.cs +++ b/framework/src/Volo.Abp.BackgroundWorkers/Volo/Abp/BackgroundWorkers/AbpBackgroundWorkersModule.cs @@ -10,10 +10,6 @@ namespace Volo.Abp.BackgroundWorkers )] public class AbpBackgroundWorkersModule : AbpModule { - public override void ConfigureServices(ServiceConfigurationContext context) - { - context.Services.AddAssemblyOf(); - } 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 b69611426c..d0bd31cb03 100644 --- a/framework/src/Volo.Abp.Caching/Volo/Abp/Caching/AbpCachingModule.cs +++ b/framework/src/Volo.Abp.Caching/Volo/Abp/Caching/AbpCachingModule.cs @@ -16,8 +16,6 @@ namespace Volo.Abp.Caching context.Services.AddMemoryCache(); context.Services.AddDistributedMemoryCache(); - context.Services.AddAssemblyOf(); - context.Services.AddSingleton(typeof(IDistributedCache<>), typeof(DistributedCache<>)); } } 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 1da0932ada..90f0487d88 100644 --- a/framework/src/Volo.Abp.Core/Volo/Abp/Modularity/AbpModule.cs +++ b/framework/src/Volo.Abp.Core/Volo/Abp/Modularity/AbpModule.cs @@ -13,6 +13,8 @@ namespace Volo.Abp.Modularity IPreConfigureServices, IPostConfigureServices { + protected internal bool SkipAutoServiceRegistration { get; protected set; } + protected internal ServiceConfigurationContext ServiceConfigurationContext { get 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 bff094c0fc..30bf523c1d 100644 --- a/framework/src/Volo.Abp.Core/Volo/Abp/Modularity/ModuleLoader.cs +++ b/framework/src/Volo.Abp.Core/Volo/Abp/Modularity/ModuleLoader.cs @@ -111,6 +111,14 @@ namespace Volo.Abp.Modularity //ConfigureServices foreach (var module in modules) { + if (module.Instance is AbpModule abpModule) + { + if (!abpModule.SkipAutoServiceRegistration) + { + services.AddAssembly(module.Type.Assembly); + } + } + module.Instance.ConfigureServices(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 4e295a6875..1a5fa8bab9 100644 --- a/framework/src/Volo.Abp.Data/Volo/Abp/Data/AbpDataModule.cs +++ b/framework/src/Volo.Abp.Data/Volo/Abp/Data/AbpDataModule.cs @@ -8,8 +8,6 @@ namespace Volo.Abp.Data public override void ConfigureServices(ServiceConfigurationContext context) { context.Services.AddSingleton(typeof(IDataFilter<>), typeof(DataFilter<>)); - - 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 6fb224a270..bf26793a01 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 @@ -30,8 +30,6 @@ namespace Volo.Abp.Application options.IgnoredInterfaces.AddIfNotContains(typeof(IUnitOfWorkEnabled)); //TODO: Move to it's own module if possible? options.IgnoredInterfaces.AddIfNotContains(typeof(IAuthorizationEnabled)); //TODO: Move to it's own module if possible? }); - - 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 581ed97592..6f9c16ce88 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 @@ -1,5 +1,4 @@ -using Microsoft.Extensions.DependencyInjection; -using Volo.Abp.Auditing; +using Volo.Abp.Auditing; using Volo.Abp.Data; using Volo.Abp.EventBus; using Volo.Abp.Guids; @@ -22,9 +21,6 @@ namespace Volo.Abp.Domain typeof(AbpUnitOfWorkModule))] public class AbpDddDomainModule : AbpModule { - public override void ConfigureServices(ServiceConfigurationContext context) - { - 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 aecb3df7fd..e3377081f4 100644 --- a/framework/src/Volo.Abp.Emailing/Volo/Abp/Emailing/AbpEmailingModule.cs +++ b/framework/src/Volo.Abp.Emailing/Volo/Abp/Emailing/AbpEmailingModule.cs @@ -38,8 +38,6 @@ namespace Volo.Abp.Emailing .SetVirtualFilePath("/Volo/Abp/Emailing/Templates/SimpleMessageTemplate.html") ); }); - - 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 de6687a112..7c42014fc4 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 @@ -1,5 +1,4 @@ -using Microsoft.Extensions.DependencyInjection; -using Volo.Abp.Modularity; +using Volo.Abp.Modularity; namespace Volo.Abp.EntityFrameworkCore.MySQL { @@ -8,9 +7,6 @@ namespace Volo.Abp.EntityFrameworkCore.MySQL )] public class AbpEntityFrameworkCoreMySQLModule : AbpModule { - public override void ConfigureServices(ServiceConfigurationContext context) - { - 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 7cbcc456f3..762e8ce355 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 @@ -1,5 +1,4 @@ -using Microsoft.Extensions.DependencyInjection; -using Volo.Abp.Modularity; +using Volo.Abp.Modularity; namespace Volo.Abp.EntityFrameworkCore.SqlServer { @@ -8,9 +7,6 @@ namespace Volo.Abp.EntityFrameworkCore.SqlServer )] public class AbpEntityFrameworkCoreSqlServerModule : AbpModule { - public override void ConfigureServices(ServiceConfigurationContext context) - { - 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 dfd770432c..8616b2ca64 100644 --- a/framework/src/Volo.Abp.EntityFrameworkCore/Volo/Abp/EntityFrameworkCore/AbpEntityFrameworkCoreModule.cs +++ b/framework/src/Volo.Abp.EntityFrameworkCore/Volo/Abp/EntityFrameworkCore/AbpEntityFrameworkCoreModule.cs @@ -25,7 +25,6 @@ namespace Volo.Abp.EntityFrameworkCore }); 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 888370e0db..0c5f97762a 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 @@ -1,14 +1,10 @@ -using Microsoft.Extensions.DependencyInjection; -using Volo.Abp.Modularity; +using Volo.Abp.Modularity; namespace Volo.Abp.EventBus.Distributed.RabbitMq { [DependsOn(typeof(AbpDistributedEventBusModule))] public class AbpRabbitMqDistributedEventBusModule : AbpModule { - public override void ConfigureServices(ServiceConfigurationContext context) - { - 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 57ea9bed6e..040aa493e7 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 @@ -1,14 +1,10 @@ -using Microsoft.Extensions.DependencyInjection; -using Volo.Abp.Modularity; +using Volo.Abp.Modularity; namespace Volo.Abp.EventBus.Distributed { [DependsOn(typeof(AbpEventBusModule))] public class AbpDistributedEventBusModule : AbpModule { - public override void ConfigureServices(ServiceConfigurationContext context) - { - 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 60d42d6453..92c15a08d7 100644 --- a/framework/src/Volo.Abp.EventBus/Volo/Abp/EventBus/AbpEventBusModule.cs +++ b/framework/src/Volo.Abp.EventBus/Volo/Abp/EventBus/AbpEventBusModule.cs @@ -13,11 +13,6 @@ namespace Volo.Abp.EventBus AddEventHandlers(context.Services); } - public override void ConfigureServices(ServiceConfigurationContext context) - { - context.Services.AddAssemblyOf(); - } - private static void AddEventHandlers(IServiceCollection services) { var handlers = new List(); 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 36a1ac4f9e..8954528ae4 100644 --- a/framework/src/Volo.Abp.Guids/Volo/Abp/Guids/AbpGuidsModule.cs +++ b/framework/src/Volo.Abp.Guids/Volo/Abp/Guids/AbpGuidsModule.cs @@ -1,13 +1,9 @@ -using Microsoft.Extensions.DependencyInjection; -using Volo.Abp.Modularity; +using Volo.Abp.Modularity; namespace Volo.Abp.Guids { public class AbpGuidsModule : AbpModule { - public override void ConfigureServices(ServiceConfigurationContext context) - { - context.Services.AddAssemblyOf(); - } + } } diff --git a/framework/src/Volo.Abp.HangFire/Volo/Abp/Hangfire/AbpHangfireModule.cs b/framework/src/Volo.Abp.HangFire/Volo/Abp/Hangfire/AbpHangfireModule.cs index f5c3123fa6..53b2ad4a42 100644 --- a/framework/src/Volo.Abp.HangFire/Volo/Abp/Hangfire/AbpHangfireModule.cs +++ b/framework/src/Volo.Abp.HangFire/Volo/Abp/Hangfire/AbpHangfireModule.cs @@ -15,8 +15,6 @@ namespace Volo.Abp.Hangfire { context.Services.ExecutePreConfiguredActions(configuration); }); - - context.Services.AddAssemblyOf(); } public override void OnApplicationInitialization(ApplicationInitializationContext context) 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 922064eec4..3e56a56e9f 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 @@ -1,13 +1,9 @@ -using Microsoft.Extensions.DependencyInjection; -using Volo.Abp.Modularity; +using Volo.Abp.Modularity; namespace Volo.Abp.Http { public class AbpHttpAbstractionsModule : AbpModule { - public override void ConfigureServices(ServiceConfigurationContext context) - { - 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 7e7df30dd1..5e9400994d 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 @@ -1,5 +1,4 @@ -using Microsoft.Extensions.DependencyInjection; -using Volo.Abp.Castle; +using Volo.Abp.Castle; using Volo.Abp.Modularity; namespace Volo.Abp.Http.Client @@ -8,9 +7,6 @@ namespace Volo.Abp.Http.Client [DependsOn(typeof(AbpCastleCoreModule))] public class AbpHttpClientModule : AbpModule { - public override void ConfigureServices(ServiceConfigurationContext context) - { - 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 6b9082b61d..689980f03f 100644 --- a/framework/src/Volo.Abp.Http/Volo/Abp/Http/AbpHttpModule.cs +++ b/framework/src/Volo.Abp.Http/Volo/Abp/Http/AbpHttpModule.cs @@ -12,8 +12,6 @@ namespace Volo.Abp.Http { public override void ConfigureServices(ServiceConfigurationContext context) { - context.Services.AddAssemblyOf(); - 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 2db93a8cca..dcb8f28dff 100644 --- a/framework/src/Volo.Abp.Json/Volo/Abp/Json/AbpJsonModule.cs +++ b/framework/src/Volo.Abp.Json/Volo/Abp/Json/AbpJsonModule.cs @@ -1,5 +1,4 @@ -using Microsoft.Extensions.DependencyInjection; -using Volo.Abp.Modularity; +using Volo.Abp.Modularity; using Volo.Abp.Timing; namespace Volo.Abp.Json @@ -7,9 +6,6 @@ namespace Volo.Abp.Json [DependsOn(typeof(AbpTimingModule))] public class AbpJsonModule : AbpModule { - public override void ConfigureServices(ServiceConfigurationContext context) - { - 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 51cabbc821..ede10efaf1 100644 --- a/framework/src/Volo.Abp.Localization/Volo/Abp/Localization/AbpLocalizationModule.cs +++ b/framework/src/Volo.Abp.Localization/Volo/Abp/Localization/AbpLocalizationModule.cs @@ -32,8 +32,6 @@ namespace Volo.Abp.Localization { options.DefinitionProviders.Add(); }); - - 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 80e499e9ed..d4f679a5b7 100644 --- a/framework/src/Volo.Abp.MemoryDb/Volo/Abp/MemoryDb/AbpMemoryDbModule.cs +++ b/framework/src/Volo.Abp.MemoryDb/Volo/Abp/MemoryDb/AbpMemoryDbModule.cs @@ -1,5 +1,4 @@ -using Microsoft.Extensions.DependencyInjection; -using Microsoft.Extensions.DependencyInjection.Extensions; +using Microsoft.Extensions.DependencyInjection.Extensions; using Volo.Abp.Domain; using Volo.Abp.Modularity; using Volo.Abp.Uow.MemoryDb; @@ -15,7 +14,6 @@ namespace Volo.Abp.MemoryDb public override void ConfigureServices(ServiceConfigurationContext context) { 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 faaebf1942..1ef58ab901 100644 --- a/framework/src/Volo.Abp.MongoDB/Volo/Abp/MongoDB/AbpMongoDbModule.cs +++ b/framework/src/Volo.Abp.MongoDB/Volo/Abp/MongoDB/AbpMongoDbModule.cs @@ -1,5 +1,4 @@ -using Microsoft.Extensions.DependencyInjection; -using Microsoft.Extensions.DependencyInjection.Extensions; +using Microsoft.Extensions.DependencyInjection.Extensions; using Volo.Abp.Domain; using Volo.Abp.Modularity; using Volo.Abp.Uow.MongoDB; @@ -12,7 +11,6 @@ namespace Volo.Abp.MongoDB public override void ConfigureServices(ServiceConfigurationContext context) { 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 1d8d6ecb52..f68440da9f 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 @@ -15,8 +15,6 @@ namespace Volo.Abp.MultiTenancy { options.ValueProviders.Add(); }); - - 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 8ac3928b7a..7fb7b039a7 100644 --- a/framework/src/Volo.Abp.ObjectMapping/Volo/Abp/ObjectMapping/AbpObjectMappingModule.cs +++ b/framework/src/Volo.Abp.ObjectMapping/Volo/Abp/ObjectMapping/AbpObjectMappingModule.cs @@ -19,10 +19,5 @@ namespace Volo.Abp.ObjectMapping ); }); } - - public override void ConfigureServices(ServiceConfigurationContext context) - { - context.Services.AddAssemblyOf(); - } } } diff --git a/framework/src/Volo.Abp.RabbitMQ/Volo/Abp/RabbitMQ/AbpRabbitMqModule.cs b/framework/src/Volo.Abp.RabbitMQ/Volo/Abp/RabbitMQ/AbpRabbitMqModule.cs index 21c31a76bc..ffaa0c00a7 100644 --- a/framework/src/Volo.Abp.RabbitMQ/Volo/Abp/RabbitMQ/AbpRabbitMqModule.cs +++ b/framework/src/Volo.Abp.RabbitMQ/Volo/Abp/RabbitMQ/AbpRabbitMqModule.cs @@ -9,11 +9,6 @@ namespace Volo.Abp.RabbitMQ )] public class AbpRabbitMqModule : AbpModule { - public override void ConfigureServices(ServiceConfigurationContext context) - { - context.Services.AddAssemblyOf(); - } - public override void OnApplicationShutdown(ApplicationShutdownContext context) { context.ServiceProvider 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 745a633fe9..f62a9566c4 100644 --- a/framework/src/Volo.Abp.Security/Volo/Abp/Security/AbpSecurityModule.cs +++ b/framework/src/Volo.Abp.Security/Volo/Abp/Security/AbpSecurityModule.cs @@ -1,13 +1,9 @@ -using Microsoft.Extensions.DependencyInjection; -using Volo.Abp.Modularity; +using Volo.Abp.Modularity; namespace Volo.Abp.Security { public class AbpSecurityModule : AbpModule { - public override void ConfigureServices(ServiceConfigurationContext context) - { - 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 0f9cbe8159..efbdc3fa37 100644 --- a/framework/src/Volo.Abp.Serialization/Volo/Abp/Serialization/AbpSerializationModule.cs +++ b/framework/src/Volo.Abp.Serialization/Volo/Abp/Serialization/AbpSerializationModule.cs @@ -19,10 +19,5 @@ namespace Volo.Abp.Serialization ); }); } - - public override void ConfigureServices(ServiceConfigurationContext context) - { - 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 bf00c590d2..ae6d61b0c8 100644 --- a/framework/src/Volo.Abp.Settings/Volo/Abp/Settings/AbpSettingsModule.cs +++ b/framework/src/Volo.Abp.Settings/Volo/Abp/Settings/AbpSettingsModule.cs @@ -1,13 +1,9 @@ -using Microsoft.Extensions.DependencyInjection; -using Volo.Abp.Modularity; +using Volo.Abp.Modularity; namespace Volo.Abp.Settings { public class AbpSettingsModule : AbpModule { - public override void ConfigureServices(ServiceConfigurationContext context) - { - 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 da7e2bbd81..f6d9ca2f9a 100644 --- a/framework/src/Volo.Abp.Sms/Volo/Abp/Sms/AbpSmsModule.cs +++ b/framework/src/Volo.Abp.Sms/Volo/Abp/Sms/AbpSmsModule.cs @@ -1,13 +1,9 @@ -using Microsoft.Extensions.DependencyInjection; -using Volo.Abp.Modularity; +using Volo.Abp.Modularity; namespace Volo.Abp.Sms { public class AbpSmsModule : AbpModule { - public override void ConfigureServices(ServiceConfigurationContext context) - { - context.Services.AddAssemblyOf(); - } + } } 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 21b89d9db2..bf72d3ce44 100644 --- a/framework/src/Volo.Abp.Threading/Volo/Abp/Threading/AbpThreadingModule.cs +++ b/framework/src/Volo.Abp.Threading/Volo/Abp/Threading/AbpThreadingModule.cs @@ -9,8 +9,6 @@ namespace Volo.Abp.Threading { context.Services.AddSingleton(NullCancellationTokenProvider.Instance); context.Services.AddSingleton(typeof(IAmbientScopeProvider<>), typeof(AmbientDataContextAmbientScopeProvider<>)); - - 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 9d88f5ecaa..d48cc01ef7 100644 --- a/framework/src/Volo.Abp.Timing/Volo/Abp/Timing/AbpTimingModule.cs +++ b/framework/src/Volo.Abp.Timing/Volo/Abp/Timing/AbpTimingModule.cs @@ -1,13 +1,9 @@ -using Microsoft.Extensions.DependencyInjection; -using Volo.Abp.Modularity; +using Volo.Abp.Modularity; namespace Volo.Abp.Timing { public class AbpTimingModule : AbpModule { - public override void ConfigureServices(ServiceConfigurationContext context) - { - 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 6c37ba14c7..c0934e0a4a 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 @@ -1,14 +1,10 @@ -using Microsoft.Extensions.DependencyInjection; -using Volo.Abp.Modularity; +using Volo.Abp.Modularity; namespace Volo.Abp.UI.Navigation { [DependsOn(typeof(AbpUiModule))] public class AbpUiNavigationModule : AbpModule { - public override void ConfigureServices(ServiceConfigurationContext context) - { - 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 20228d5a6d..9198e6be6c 100644 --- a/framework/src/Volo.Abp.UI/Volo/Abp/Ui/AbpUiModule.cs +++ b/framework/src/Volo.Abp.UI/Volo/Abp/Ui/AbpUiModule.cs @@ -22,8 +22,6 @@ namespace Volo.Abp.UI { options.Resources.Add("en").AddVirtualJson("/Localization/Resources/AbpUi"); }); - - 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 2ff058ec3f..f7f0c55add 100644 --- a/framework/src/Volo.Abp.Uow/Volo/Abp/Uow/AbpUnitOfWorkModule.cs +++ b/framework/src/Volo.Abp.Uow/Volo/Abp/Uow/AbpUnitOfWorkModule.cs @@ -9,10 +9,5 @@ namespace Volo.Abp.Uow { context.Services.OnRegistred(UnitOfWorkInterceptorRegistrar.RegisterIfNeeded); } - - public override void ConfigureServices(ServiceConfigurationContext context) - { - 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 c110dd8fde..03efe9d66a 100644 --- a/framework/src/Volo.Abp.Validation/Volo/Abp/Validation/AbpValidationModule.cs +++ b/framework/src/Volo.Abp.Validation/Volo/Abp/Validation/AbpValidationModule.cs @@ -9,10 +9,5 @@ namespace Volo.Abp.Validation { context.Services.OnRegistred(ValidationInterceptorRegistrar.RegisterIfNeeded); } - - public override void ConfigureServices(ServiceConfigurationContext context) - { - 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 ace58f8b51..cf2009ec01 100644 --- a/framework/src/Volo.Abp.VirtualFileSystem/Volo/Abp/VirtualFileSystem/AbpVirtualFileSystemModule.cs +++ b/framework/src/Volo.Abp.VirtualFileSystem/Volo/Abp/VirtualFileSystem/AbpVirtualFileSystemModule.cs @@ -1,13 +1,9 @@ -using Microsoft.Extensions.DependencyInjection; -using Volo.Abp.Modularity; +using Volo.Abp.Modularity; namespace Volo.Abp.VirtualFileSystem { public class AbpVirtualFileSystemModule : AbpModule { - public override void ConfigureServices(ServiceConfigurationContext context) - { - context.Services.AddAssemblyOf(); - } + } } diff --git a/framework/test/SimpleConsoleDemo/Program.cs b/framework/test/SimpleConsoleDemo/Program.cs index 27706872d8..08c6371bfb 100644 --- a/framework/test/SimpleConsoleDemo/Program.cs +++ b/framework/test/SimpleConsoleDemo/Program.cs @@ -32,10 +32,7 @@ namespace SimpleConsoleDemo public class MyConsoleModule : AbpModule { - public override void ConfigureServices(ServiceConfigurationContext context) - { - context.Services.AddAssemblyOf(); - } + } public interface IMessageWriter 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 b6924f0485..65595b1b48 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 @@ -72,8 +72,6 @@ namespace Volo.Abp.AspNetCore.Mvc .Add("en") .AddVirtualJson("/Volo/Abp/AspNetCore/Mvc/Localization/Resource"); }); - - 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 01a2828867..c1edaa3ef8 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 @@ -1,5 +1,4 @@ -using Microsoft.Extensions.DependencyInjection; -using Volo.Abp.AspNetCore.TestBase; +using Volo.Abp.AspNetCore.TestBase; using Volo.Abp.Modularity; namespace Volo.Abp.AspNetCore.Mvc.UI.Bootstrap.Demo @@ -10,9 +9,6 @@ namespace Volo.Abp.AspNetCore.Mvc.UI.Bootstrap.Demo )] public class AbpAspNetCoreMvcUiBootstrapDemoTestModule : AbpModule { - public override void ConfigureServices(ServiceConfigurationContext context) - { - 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 3271ce1588..2386ee6320 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 @@ -1,6 +1,5 @@ using Microsoft.AspNetCore.Builder; using Microsoft.AspNetCore.Hosting; -using Microsoft.Extensions.DependencyInjection; using Volo.Abp.AspNetCore.Modularity; using Volo.Abp.AspNetCore.Mvc.UI.Theme.Basic; using Volo.Abp.Autofac; @@ -14,11 +13,6 @@ namespace Volo.Abp.AspNetCore.Mvc.UI.Bootstrap.Demo )] public class AbpAspNetCoreMvcUiBootstrapDemoModule : AbpModule { - public override void ConfigureServices(ServiceConfigurationContext context) - { - context.Services.AddAssemblyOf(); - } - public override void OnApplicationInitialization(ApplicationInitializationContext context) { var app = context.GetApplicationBuilder(); 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 2d752f8d80..b78c00b791 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 @@ -1,5 +1,4 @@ -using Microsoft.Extensions.DependencyInjection; -using Volo.Abp.AspNetCore.Mvc.UI.Bundling; +using Volo.Abp.AspNetCore.Mvc.UI.Bundling; using Volo.Abp.AspNetCore.TestBase; using Volo.Abp.Autofac; using Volo.Abp.Modularity; @@ -13,9 +12,6 @@ namespace Volo.Abp.AspNetCore.Mvc.UI )] public class AbpAspNetCoreMvcUiTestModule : AbpModule { - public override void ConfigureServices(ServiceConfigurationContext context) - { - 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 cb47f101a7..1c0f3feea6 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 @@ -47,8 +47,6 @@ namespace Volo.Abp.AspNetCore.Mvc.Versioning options.ConfigureAbp(context.Services); }); - context.Services.AddAssemblyOf(); - context.Services.AddHttpClientProxies(typeof(AbpAspNetCoreMvcVersioningTestModule).Assembly); context.Services.Configure(options => 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 5bbcb2ba81..5f563e8384 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 @@ -27,8 +27,6 @@ namespace Volo.Abp.Authorization { options.DefinitionProviders.TryAdd(); }); - - context.Services.AddAssemblyOf(); } } } \ No newline at end of file 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 4c8fbf25ac..19bb8aa5c8 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 @@ -12,8 +12,6 @@ namespace Volo.Abp.AutoMapper { options.UseStaticMapper = false; }); - - 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 a476048e70..97957657a5 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 @@ -1,14 +1,10 @@ -using Microsoft.Extensions.DependencyInjection; -using Volo.Abp.Modularity; +using Volo.Abp.Modularity; namespace Volo.Abp.Autofac { [DependsOn(typeof(AbpAutofacModule))] public class AutofacTestModule : AbpModule { - public override void ConfigureServices(ServiceConfigurationContext context) - { - context.Services.AddAssemblyOf(); - } + } } \ No newline at end of file diff --git a/framework/test/Volo.Abp.BackgroundJobs.Tests/Volo/Abp/BackgroundJobs/AbpBackgroundJobsTestModule.cs b/framework/test/Volo.Abp.BackgroundJobs.Tests/Volo/Abp/BackgroundJobs/AbpBackgroundJobsTestModule.cs index 50a0199426..104df294b8 100644 --- a/framework/test/Volo.Abp.BackgroundJobs.Tests/Volo/Abp/BackgroundJobs/AbpBackgroundJobsTestModule.cs +++ b/framework/test/Volo.Abp.BackgroundJobs.Tests/Volo/Abp/BackgroundJobs/AbpBackgroundJobsTestModule.cs @@ -1,5 +1,4 @@ -using Microsoft.Extensions.DependencyInjection; -using Volo.Abp.Autofac; +using Volo.Abp.Autofac; using Volo.Abp.Modularity; namespace Volo.Abp.BackgroundJobs @@ -11,9 +10,6 @@ namespace Volo.Abp.BackgroundJobs )] public class AbpBackgroundJobsTestModule : AbpModule { - public override void ConfigureServices(ServiceConfigurationContext context) - { - 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 03dc6e54bd..e036c4301c 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 @@ -1,14 +1,10 @@ -using Microsoft.Extensions.DependencyInjection; -using Volo.Abp.Modularity; +using Volo.Abp.Modularity; namespace Volo.Abp.Caching { [DependsOn(typeof(AbpCachingModule))] public class AbpCachingTestModule : AbpModule { - public override void ConfigureServices(ServiceConfigurationContext context) - { - context.Services.AddAssemblyOf(); - } + } } \ No newline at end of file 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 089fe2a337..02142f06d9 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 @@ -18,8 +18,6 @@ namespace Volo.Abp.EntityFrameworkCore.TestApp.SecondContext { options.AddDefaultRepositories(); }); - - 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 6102fe12ae..f955a7fa14 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 @@ -21,8 +21,6 @@ namespace Volo.Abp.EntityFrameworkCore { public override void ConfigureServices(ServiceConfigurationContext context) { - context.Services.AddAssemblyOf(); - context.Services.AddAbpDbContext(options => { options.AddDefaultRepositories(true); 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 e7f8b40ddd..f514f37018 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 @@ -1,4 +1,3 @@ -using Microsoft.Extensions.DependencyInjection; using Volo.Abp.Modularity; namespace Volo.Abp.EventBus @@ -6,9 +5,6 @@ namespace Volo.Abp.EventBus [DependsOn(typeof(AbpEventBusModule))] public class EventBusTestModule : AbpModule { - public override void ConfigureServices(ServiceConfigurationContext context) - { - 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 f0313110c9..b6237a12ad 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 @@ -12,8 +12,6 @@ namespace Volo.Abp.Http { public override void ConfigureServices(ServiceConfigurationContext context) { - context.Services.AddAssemblyOf(); - context.Services.AddHttpClientProxies(typeof(TestAppModule).Assembly); context.Services.AddHttpClientProxy(); 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 2bc87b0ed3..e9527a3763 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 @@ -29,8 +29,6 @@ namespace Volo.Abp.MemoryDb options.AddDefaultRepositories(); options.AddRepository(); }); - - 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 3dba5cdd8a..e1cbefa59f 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 @@ -30,8 +30,6 @@ namespace Volo.Abp.MongoDB options.AddDefaultRepositories(); options.AddRepository(); }); - - 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 cd5b6fc3e0..803d5a37ef 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 @@ -1,14 +1,10 @@ -using Microsoft.Extensions.DependencyInjection; -using Volo.Abp.Modularity; +using Volo.Abp.Modularity; namespace Volo.Abp.Serialization { [DependsOn(typeof(AbpSerializationModule))] public class AbpSerializationTestModule : AbpModule { - public override void ConfigureServices(ServiceConfigurationContext context) - { - 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 1c27fcd426..5d8cba2302 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 @@ -1,5 +1,4 @@ -using Microsoft.Extensions.DependencyInjection; -using Volo.Abp.MemoryDb; +using Volo.Abp.MemoryDb; using Volo.Abp.Modularity; namespace Volo.Abp.TestApp @@ -7,9 +6,6 @@ namespace Volo.Abp.TestApp [DependsOn(typeof(AbpMemoryDbTestModule))] public class TestAppTestModule : AbpModule { - public override void ConfigureServices(ServiceConfigurationContext context) - { - 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 1f26a29231..4de2e405e1 100644 --- a/framework/test/Volo.Abp.TestApp/Volo/Abp/TestApp/TestAppModule.cs +++ b/framework/test/Volo.Abp.TestApp/Volo/Abp/TestApp/TestAppModule.cs @@ -19,8 +19,6 @@ namespace Volo.Abp.TestApp public override void ConfigureServices(ServiceConfigurationContext context) { ConfigureAutoMapper(context.Services); - - context.Services.AddAssemblyOf(); } public override void OnApplicationInitialization(ApplicationInitializationContext context)