Overridable injections for Microsoft.Extensions.DependencyInjection.
varprovider=newServiceCollection().AddTransient<IExampleService1,ExampleService1A>()// REQUIRED: Adds override capability for IExampleService1.AddOverridability(typeof(IExampleService1)).BuildServiceProvider();// SCOPEusing(varscope=provider.CreateScope()){// Override the service implementation for this scopescope.Override<IExampleService1,ExampleService1B>();// Testing the overridevarserviceInstance=scope.ServiceProvider.GetRequiredService<IExampleService1>();Console.WriteLine($"IExampleService1 overridden: {serviceInstanceisExampleService1B}");}