Migrating from 'LightInject' to .netcore DI container.
What are the .netcore DI container equivalents of below LightInject related registrations?
a. container.RegisterConstructorDependency<IBar>((factory, parameterInfo) => new Bar());
b. container.RegisterInstance<Func<string, string>>
((username, password) => new MemCache(userId, password, container.GetInstance<IBusinessLogic>()));
I believe A would be something like this:
For B, if you have an instance that already exists that you simply want to register, then you could do something like:
But it seems like you actually want to register a factory, so I would suggest something like this: