sample-dotnet-core-cqrs-api icon indicating copy to clipboard operation
sample-dotnet-core-cqrs-api copied to clipboard

Decorator registration is not working with Autofac 6.x

Open junaidahmed92 opened this issue 4 years ago • 1 comments

Hi, I've implemented CQRS by following your repo. However I noticed that the decorator registration is now working with Autofac 6.x

builder.RegisterGenericDecorator( typeof(UnitOfWorkCommandHandlerWithResultDecorator<,>), typeof(ICommandHandler<,>));

I found different links on github with same issue but none of them really helps https://github.com/autofac/Autofac/issues/1098 https://github.com/kgrzybek/modular-monolith-with-ddd/issues/68

Can you explain how can we solve this issue with latest version of Autofac?

junaidahmed92 avatar Jun 11 '21 07:06 junaidahmed92

I've created a sample app to demonstrate Requests processing in the latest Autofac & MediatR versions: github.com/LeftTwixWand/ModernCQRS

The sample output: CQRS

LeftTwixWand avatar Jan 31 '22 16:01 LeftTwixWand