I've been recently trying to use https://github.com/ybainier/Hypodermic for dependency injection on C++. Yet, I am unable to find if it supports the OnActivating event from AutoFac:
builder.RegisterInstance(instance).OnActivating(MyLambdaHere)
Is there any way on Hypodermic to mimic this functionality?
This feature comes with the new release (0.1.2). You can use it like so:
builder.registerInstance(instance)->onActivating(
[](IActivatingData< MyStaticInstanceType >& data) -> void
{
// Your "Activating" code here
}
);
Besides, IRegistrationBuilder
exposes onPreparing()
and onActivated()
as well. I hope that helps.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With