private DryIocObjectFactory( DryIocObjectFactory parentFactory, IAspectComposer aspects, Action cleanup) : this(parentFactory.CurrentScope, aspects) { this.ParentFactory = parentFactory; this.Cleanup = cleanup; }
private DryIocObjectFactory( DryIocObjectFactory parentFactory, IAspectComposer aspects, Action cleanup) : this(parentFactory.CurrentScope, aspects) { this.ParentFactory = parentFactory; this.Cleanup = cleanup; }
public IObjectFactory CreateScope(string id) { BuildScopeIfRequired(); var innerComposer = Aspects.CreateInnerComposer(); DryIocObjectFactory tv; Action cleanup = string.IsNullOrEmpty(id) ? (Action)null : () => TaggedScopes.TryRemove(id, out tv); var factory = new DryIocObjectFactory(this, innerComposer, cleanup); factory.RegisterInstance<IObjectFactory>(factory); factory.RegisterInterfaces(innerComposer); if (!string.IsNullOrEmpty(id)) TaggedScopes.TryAdd(id, factory); return factory; }
public IObjectFactory CreateScope(string id) { BuildScopeIfRequired(); var innerComposer = Aspects.CreateInnerComposer(); DryIocObjectFactory tv; Action cleanup = string.IsNullOrEmpty(id) ? (Action)null : () => TaggedScopes.TryRemove(id, out tv); var factory = new DryIocObjectFactory(this, innerComposer, cleanup); factory.RegisterInstance <IObjectFactory>(factory); factory.RegisterInterfaces(innerComposer); if (!string.IsNullOrEmpty(id)) { TaggedScopes.TryAdd(id, factory); } return(factory); }