I am trying using DI add in my startup class Singleton. I would like to based on processorStringName which comes from appSettings and Factory class add proper processor? Is it possible to do this in a nice way?
IProcessor processor = ProcessorFactory.CreateProcessor(Configuration, processorStringName);
services.AddSingleton<IProcessor, processor>();