I have a class with a constructor that looks like the following:
public BatchService(IRepository repository, ILogger logger, string user)
In my DI bootstrapper class, I have the following RegisterType
command:
.RegisterType<BatchService>(
new InjectionConstructor(
new ResolvedParameter<IRepository>("SomeRepository"),
new ResolvedParameter<ILogger>("DatabaseLogger")))
In my client code, I want to instantiate BatchService
as follows:
BatchService batchService = DIContainer.Resolve<BatchService>()
As you can see, I have a string parameter called user
as part of the constructor to BatchService
that is not part of the DI logic. How should I best handle this situation if I need to use user
in the BatchService
class?