Skip to content

Commit

Permalink
Merge pull request #112 from leancodepl/fix/contravariant-registration
Browse files Browse the repository at this point in the history
Fix contravariant registration
  • Loading branch information
lukaszgarstecki authored Sep 17, 2020
2 parents fb8c75c + 8ddd412 commit aade0b6
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
3 changes: 3 additions & 0 deletions src/Domain/LeanCode.CQRS.Default/SharedCQRSModule.cs
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
using Autofac;
using Autofac.Features.Variance;
using LeanCode.CQRS.Cache;
using LeanCode.CQRS.Default.Autofac;
using LeanCode.CQRS.Execution;
Expand Down Expand Up @@ -46,6 +47,8 @@ protected override void Load(ContainerBuilder builder)
builder.RegisterType<SimpleFinalizer>().AsSelf();

builder.RegisterType<AutofacEventHandlerResolver>().As<IDomainEventHandlerResolver>();

builder.RegisterSource(new ContravariantRegistrationSource());
}
}
}
3 changes: 0 additions & 3 deletions src/Domain/LeanCode.CQRS.Default/TypedCQRSModule.cs
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
using Autofac;
using Autofac.Features.Variance;
using LeanCode.Components;
using LeanCode.CQRS.Default.Autofac;
using LeanCode.CQRS.Execution;
Expand Down Expand Up @@ -29,8 +28,6 @@ public TypedCQRSModule(

protected override void Load(ContainerBuilder builder)
{
builder.RegisterSource(new ContravariantRegistrationSource());

builder.RegisterAssemblyTypes(catalog.Assemblies).AsClosedTypesOf(typeof(ICommandHandler<,>));
builder.RegisterAssemblyTypes(catalog.Assemblies).AsClosedTypesOf(typeof(IQueryHandler<,,>));
builder.RegisterAssemblyTypes(catalog.Assemblies).AsClosedTypesOf(typeof(IDomainEventHandler<>));
Expand Down

0 comments on commit aade0b6

Please sign in to comment.