/// <summary> /// Configure the services (does nothing here: this just tests the parameter /// injection of the startup services). /// </summary> /// <param name="register">This one is the only required parameter.</param> /// <param name="ambientObjects"> /// IStObjObjectMap is available: configuring services can rely on any IRealObject since they are already initialized (this /// is even available in the RegisterStartupServices). /// </param> /// <param name="superService">This is injected.</param> /// <param name="ext">This is injected.</param> /// <param name="optionalService"> /// This is injected if it exists in the StartupServices: startup services can be optional. /// </param> void ConfigureServices(StObjContextRoot.ServiceRegister register, IStObjObjectMap ambientObjects, SuperStartupService superService, TotallyExternalStartupServiceThatActAsAConfiguratorOfTheWholeSystem ext, IOptionalStartupService?optionalService = null) { ambientObjects.Obtain <IA1>().Should().BeSameAs(this); superService.Should().NotBeNull(); ext.Should().NotBeNull(); superService.Talk(register.Monitor); }
void ConfigureServices(StObjContextRoot.ServiceRegister register, TotallyExternalStartupServiceThatActAsAConfiguratorOfTheWholeSystem conf) { var impl = conf.AlwaysUseAlice ? typeof(PrivateAlwaysAliceProvider) : typeof(PrivateAliceOrBobProvider); register.Register(typeof(IAliceOrBobProvider), impl, isScoped: true, allowMultipleRegistration: false); }