Closed mgth closed 3 years ago
Thanks for reporting, and for the PR!
Yes, there is an additional method to achieve something similar, you can configure an initializer delegate on registration:
.Register<MainClass>(c => c.WithInitializer(mainClass => mainClass.InjectB()));
To resolve dependencies, you can use a delegate with an extra IDependencyResolver
parameter like:
.Register<MainClass>(c => c.WithInitializer((mainClass, resolver) => mainClass.InjectB(resolver.Resolve<B>())));
Dependency properties in base class are OK, but method is not injected. by the way, I did not find a way to inject methods without using attributs (or declaring my own attribut). Is there one?