Attempting to Register:
Register(typeof(IThing<>), typeof(DefaultThing<>)).AsSingleton();
fails with:
TinyIocRegistrationException : Type DefaultThing1 is not valid for a registration of type IThing
1
----> System.ArgumentException : Invalid generic arguments
Parameter name: typeArguments
@cmckeegan:
Started work on this here:
https://github.com/grumpydev/TinyIoC/tree/OpenGenerics
Currently a few things are broken (but fixable), but there's now a passing test that registers IThing<> with RealThing<> and resolves IThing
Have you merged it into the master brunch yet?
@JoergEg yes, it's in master, but it's currently limited to single manual registrations, need to do more work to automatically scan/register multiple registrations.
Is this really still open?
This is currently keeping me from using TinyIoC with MediatR. I need to do something like this to hookup MediatR:
container.Register(typeof (IRequestHandler<,>));
But I'm receiving the error, abstract classes or interfaces are not valid implementation types for SingletonFactory
. Any chance this could be addressed?
Most helpful comment
This is currently keeping me from using TinyIoC with MediatR. I need to do something like this to hookup MediatR:
container.Register(typeof (IRequestHandler<,>));
But I'm receiving the error,
abstract classes or interfaces are not valid implementation types for SingletonFactory
. Any chance this could be addressed?