diff --git a/src/Volo.Abp.Autofac/Autofac/Builder/AbpRegistrationBuilderExtensions.cs b/src/Volo.Abp.Autofac/Autofac/Builder/AbpRegistrationBuilderExtensions.cs index 11a81aa61b..76580125fa 100644 --- a/src/Volo.Abp.Autofac/Autofac/Builder/AbpRegistrationBuilderExtensions.cs +++ b/src/Volo.Abp.Autofac/Autofac/Builder/AbpRegistrationBuilderExtensions.cs @@ -31,18 +31,15 @@ namespace Autofac.Builder } registrationBuilder = registrationBuilder.EnablePropertyInjection(moduleContainer, implementationType); - registrationBuilder = registrationBuilder.InvokeRegistrationActions(registrationActionList, serviceType); + registrationBuilder = registrationBuilder.InvokeRegistrationActions(registrationActionList, serviceType, implementationType); return registrationBuilder; } - private static IRegistrationBuilder InvokeRegistrationActions( - this IRegistrationBuilder registrationBuilder, - ServiceRegistrationActionList registrationActionList, - Type serviceType) + private static IRegistrationBuilder InvokeRegistrationActions(this IRegistrationBuilder registrationBuilder, ServiceRegistrationActionList registrationActionList, Type serviceType, Type implementationType) where TConcreteReflectionActivatorData : ConcreteReflectionActivatorData { - var serviceRegistredArgs = new OnServiceRegistredContext(serviceType); + var serviceRegistredArgs = new OnServiceRegistredContext(serviceType, implementationType); foreach (var registrationAction in registrationActionList) { diff --git a/src/Volo.Abp.Core/Volo/Abp/DependencyInjection/OnServiceRegistredContext.cs b/src/Volo.Abp.Core/Volo/Abp/DependencyInjection/OnServiceRegistredContext.cs index 9aaae20b54..0c9e27d20e 100644 --- a/src/Volo.Abp.Core/Volo/Abp/DependencyInjection/OnServiceRegistredContext.cs +++ b/src/Volo.Abp.Core/Volo/Abp/DependencyInjection/OnServiceRegistredContext.cs @@ -9,10 +9,13 @@ namespace Volo.Abp.DependencyInjection { public virtual ITypeList Interceptors { get; } + public virtual Type ServiceType { get; } + public virtual Type ImplementationType { get; } - public OnServiceRegistredContext([NotNull] Type implementationType) + public OnServiceRegistredContext(Type serviceType, [NotNull] Type implementationType) { + ServiceType = Check.NotNull(serviceType, nameof(serviceType)); ImplementationType = Check.NotNull(implementationType, nameof(implementationType)); Interceptors = new TypeList(); diff --git a/test/Abp.IdentityServer.EntityFrameworkCore.Tests/Abp.IdentityServer.EntityFrameworkCore.Tests.csproj b/test/Abp.IdentityServer.EntityFrameworkCore.Tests/Abp.IdentityServer.EntityFrameworkCore.Tests.csproj index 23d2048db4..73a4c2ac03 100644 --- a/test/Abp.IdentityServer.EntityFrameworkCore.Tests/Abp.IdentityServer.EntityFrameworkCore.Tests.csproj +++ b/test/Abp.IdentityServer.EntityFrameworkCore.Tests/Abp.IdentityServer.EntityFrameworkCore.Tests.csproj @@ -13,6 +13,7 @@ + diff --git a/test/Abp.IdentityServer.EntityFrameworkCore.Tests/Volo/Abp/IdentityServer/AbpIdentityApplicationTestBase.cs b/test/Abp.IdentityServer.EntityFrameworkCore.Tests/Volo/Abp/IdentityServer/AbpIdentityApplicationTestBase.cs index 2897897ab2..b102a72329 100644 --- a/test/Abp.IdentityServer.EntityFrameworkCore.Tests/Volo/Abp/IdentityServer/AbpIdentityApplicationTestBase.cs +++ b/test/Abp.IdentityServer.EntityFrameworkCore.Tests/Volo/Abp/IdentityServer/AbpIdentityApplicationTestBase.cs @@ -1,6 +1,4 @@ -using Volo.Abp.TestBase; - -namespace Volo.Abp.IdentityServer +namespace Volo.Abp.IdentityServer { public class AbpIdentityServerTestBase : AbpIntegratedTest { diff --git a/test/Abp.IdentityServer.EntityFrameworkCore.Tests/Volo/Abp/IdentityServer/AbpIdentityServerTestEntityFrameworkCoreModule.cs b/test/Abp.IdentityServer.EntityFrameworkCore.Tests/Volo/Abp/IdentityServer/AbpIdentityServerTestEntityFrameworkCoreModule.cs index f5a3efe323..0491499be8 100644 --- a/test/Abp.IdentityServer.EntityFrameworkCore.Tests/Volo/Abp/IdentityServer/AbpIdentityServerTestEntityFrameworkCoreModule.cs +++ b/test/Abp.IdentityServer.EntityFrameworkCore.Tests/Volo/Abp/IdentityServer/AbpIdentityServerTestEntityFrameworkCoreModule.cs @@ -3,6 +3,7 @@ using Microsoft.EntityFrameworkCore; using Microsoft.Extensions.DependencyInjection; using Volo.Abp.Autofac; using Volo.Abp.EntityFrameworkCore; +using Volo.Abp.Identity.EntityFrameworkCore; using Volo.Abp.IdentityServer.EntityFrameworkCore; using Volo.Abp.Modularity; using Volo.Abp.Uow; @@ -11,6 +12,7 @@ namespace Volo.Abp.IdentityServer { [DependsOn(typeof(AbpAutofacModule))] [DependsOn(typeof(AbpIdentityServerEntityFrameworkCoreModule))] + [DependsOn(typeof(AbpIdentityEntityFrameworkCoreModule))] public class AbpIdentityServerTestEntityFrameworkCoreModule : AbpModule { public override void ConfigureServices(IServiceCollection services) diff --git a/test/Volo.Abp.Ddd.Tests/Volo/Abp/Uow/UnitOfWork_Ambient_Scope_Tests.cs b/test/Volo.Abp.Ddd.Tests/Volo/Abp/Uow/UnitOfWork_Ambient_Scope_Tests.cs index 48c236c886..19f8fa1bde 100644 --- a/test/Volo.Abp.Ddd.Tests/Volo/Abp/Uow/UnitOfWork_Ambient_Scope_Tests.cs +++ b/test/Volo.Abp.Ddd.Tests/Volo/Abp/Uow/UnitOfWork_Ambient_Scope_Tests.cs @@ -1,7 +1,6 @@ using System.Threading.Tasks; using Microsoft.Extensions.DependencyInjection; using Shouldly; -using Volo.Abp.TestBase; using Xunit; namespace Volo.Abp.Uow diff --git a/test/Volo.Abp.Ddd.Tests/Volo/Abp/Uow/UnitOfWork_Events_Tests.cs b/test/Volo.Abp.Ddd.Tests/Volo/Abp/Uow/UnitOfWork_Events_Tests.cs index 9561b34ba4..2f99745c03 100644 --- a/test/Volo.Abp.Ddd.Tests/Volo/Abp/Uow/UnitOfWork_Events_Tests.cs +++ b/test/Volo.Abp.Ddd.Tests/Volo/Abp/Uow/UnitOfWork_Events_Tests.cs @@ -1,7 +1,6 @@ using System; using Microsoft.Extensions.DependencyInjection; using Shouldly; -using Volo.Abp.TestBase; using Xunit; namespace Volo.Abp.Uow diff --git a/test/Volo.Abp.Ddd.Tests/Volo/Abp/Uow/UnitOfWork_Nested_Tests.cs b/test/Volo.Abp.Ddd.Tests/Volo/Abp/Uow/UnitOfWork_Nested_Tests.cs index e42092ad66..06fd20b569 100644 --- a/test/Volo.Abp.Ddd.Tests/Volo/Abp/Uow/UnitOfWork_Nested_Tests.cs +++ b/test/Volo.Abp.Ddd.Tests/Volo/Abp/Uow/UnitOfWork_Nested_Tests.cs @@ -1,7 +1,6 @@ using System.Threading.Tasks; using Microsoft.Extensions.DependencyInjection; using Shouldly; -using Volo.Abp.TestBase; using Xunit; namespace Volo.Abp.Uow