private static bool IsCandidateCtor(IBasicConstructionInfo candidateFactoryMethod, MethodBase ctor) { var ctorCarameters = ctor.GetParameters(); return(((candidateFactoryMethod == null) || (candidateFactoryMethod.ParameterCount < ctorCarameters.Length)) && IsNotCopyConstructor(ctor.DeclaringType, ctorCarameters)); }
private static ConstructionDataInfo <ConstructorInfo>[] GetGreediestAvailableNewingInfos( IEnumerable <ConstructorInfo> constructors, ConstructionKey key, IBasicConstructionInfo greediestUnconditionalFactoryInfo) { var candidateConstructors = constructors .Filter(greediestUnconditionalFactoryInfo, IsCandidateCtor); return(CreateConstructionInfo(candidateConstructors, ctor => new ObjectNewingInfo(ctor, key))); }