-
Notifications
You must be signed in to change notification settings - Fork 31
Closed
Description
I am writing a WebAPI that uses CQRS, and I want to be able to register all implementations of CommandHandler<T> in a set of given assemblies. It looks like open generic registration is implemented like this:
registrations.Export(typeof(CommandHandler<>))
.As(typeof(ICommandHandler<>));
Am I heading in the right direction, and how can I auto-register all implementations of CommandHandler<T> in a given set of assemblies?
Update : actually, the above doesn't work in my situation; CommandHandler<T> is an abstract base class used by the actual command handlers, and as such it has a protected constructor with a single parameter. Grace complains that the class doesn't have a public constructor, and fails the resolution. If I register individual command handlers individually, then everything works fine.
Metadata
Metadata
Assignees
Labels
No labels