public DefaultBindToInScopeWithDescendantFilterOrUniqueOrNamed(StandardKernel kernel, DefaultMapping defaultMapping) { _kernel = kernel; _mapping = defaultMapping; // This makes the most sense by default; when using ToFactory // it gets set to false implicitly. _mapping.UniquePerScope = true; }
public IBindToInScopeWithDescendantFilterOrUniqueOrNamed Bind(Type @interface) { List <IMapping> list; if (!_bindings.ContainsKey(@interface)) { list = new List <IMapping>(); _bindings[@interface] = list; } else { list = _bindings[@interface]; } var mapping = new DefaultMapping(); mapping.Target = @interface; list.Add(mapping); return(new DefaultBindToInScopeWithDescendantFilterOrUniqueOrNamed(this, mapping)); }
public IBindToInScopeWithDescendantFilterOrUniqueOrNamed <TInterface> Bind <TInterface>() { List <IMapping> list; if (!_bindings.ContainsKey(typeof(TInterface))) { list = new List <IMapping>(); _bindings[typeof(TInterface)] = list; } else { list = _bindings[typeof(TInterface)]; } var mapping = new DefaultMapping(); mapping.Target = typeof(TInterface); list.Add(mapping); return(new DefaultBindToInScopeWithDescendantFilterOrUnique <TInterface>(this, mapping)); }
public DefaultBindToInScopeWithDescendantFilterOrUnique(StandardKernel kernel, DefaultMapping defaultMapping) : base(kernel, defaultMapping) { }