public void Configure <T>(Func <T> componentFactory, DependencyLifecycle dependencyLifecycle) { var componentType = typeof(T); if (HasComponent(componentType)) { return; } var funcFactory = new ArbitraryFuncDelegatingFactoryObject <T>(componentFactory, dependencyLifecycle == DependencyLifecycle.SingleInstance); context.ObjectFactory.RegisterSingleton(componentType.FullName, funcFactory); }
void IContainer.Configure <T>(Func <T> componentFactory, DependencyLifecycle dependencyLifecycle) { var componentType = typeof(T); if (((IContainer)this).HasComponent(componentType)) { return; } var funcFactory = new ArbitraryFuncDelegatingFactoryObject <T>(componentFactory, dependencyLifecycle == DependencyLifecycle.SingleInstance); ((IConfigurableApplicationContext)context).ObjectFactory.RegisterSingleton(componentType.FullName, funcFactory); }