Closed dazinator closed 4 years ago
Allow named services to be registered with factory functions that take an SP
var services = new ServiceCollection(); services.AddNamed<AnimalService>(names => { names.AddSingleton("A", (sp)=>new AnimalService()); names.AddSingleton("B", (sp)=>new BearService()); names.AddTransient("C", (sp)=>new AnimalService()); names.AddTransient("D", (sp)=>new LionService()); names.AddScoped("E", (sp)=>new AnimalService()); names.AddScoped("F", (sp)=>new DisposableTigerService()); });
Allow named services to be registered with factory functions that take an SP