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