public virtual void ProcessModel(IKernel kernel, ComponentModel model) { var targetType = model.Implementation; var constructors = targetType.GetConstructors(BindingFlags.Public | BindingFlags.Instance); foreach (var constructor in constructors) { // We register each public constructor // and let the ComponentFactory select an // eligible amongst the candidates later model.AddConstructor(CreateConstructorCandidate(model, constructor)); } }
public virtual void ProcessModel(IKernel kernel, ComponentModel model) { var targetType = model.Implementation; var constructors = InjectionAttribute.GetConstructors(targetType).Where(IsVisibleToContainer).ToArray(); if (constructors.Length == 0) { constructors = targetType.GetConstructors(BindingFlags.Public | BindingFlags.Instance) .Where(IsVisibleToContainer).ToArray(); } foreach (var constructor in constructors) { // We register each public constructor // and let the ComponentFactory select an // eligible amongst the candidates later model.AddConstructor(CreateConstructorCandidate(model, constructor)); } }