static public object CreateBestInstance(this Type item, params object[] arguments) { return(item.GetFilteredConstructors(Filterer_ConstructorInfo.CanEffectiveParametersHold(arguments)) .GetFirst() .IfNotNull(c => c.Invoke(null, arguments))); }
public FactoryBase(Type type, IEnumerable <Type> parameter_types) { constructor_invoker = type.GetFilteredConstructors( Filterer_ConstructorInfo.CanEffectiveParametersHold(parameter_types) ).GetFirst().GetConstructorInvoker <T>(); }