public BindingDiscoverer(IContainer container, IActivationManager activationManager, ITypeSystem typeSystem, ITypeDiscoverer typeDiscoverer) { var conventionTypes = typeDiscoverer.FindMultiple(typeof(IBindingConvention)); foreach (var conventionType in conventionTypes) { var instance = typeSystem.GetDefinitionFor(conventionType).CreateInstance(container); _conventions.Add((IBindingConvention)instance); } _activationManager = activationManager; }
public void Register(IBinding binding) { if (binding.Scope == null && binding.Target != null) { if (_typeSystem.GetDefinitionFor(binding.Target).HasSingletonAttribute) { binding.Scope = In.SingletonScope(); } } _bindings[binding.Service] = binding; }