public static ConstructorInfo GetConstructor(this Type type, Type[] types)
{
foreach(var constructor in type.GetTypeInfo().DeclaredConstructors)
{
var parameters = constructor.GetParameters();
if(types.Length == parameters.Length)
{
bool mismatch = false;
for(int i = 0; i < types.Length; i++)
{
if(types[i].FullName != parameters[i].ParameterType.FullName)
{
mismatch = true;
break;
}
}
if(!mismatch)
{
return constructor;
}
}
}
return null;
}
public static MethodInfo GetMethod(this Type type, string name)