In .NET Framework such method exists:
public ConstructorInfo GetConstructor(
    BindingFlags bindingAttr,
    Binder binder,
    CallingConventions callConvention,
    Type[] types,
    ParameterModifier[] modifiers
)
But in .NET Core (1.1) I found only extension, which doesn't give me private constructor:
public static ConstructorInfo GetConstructor(this Type type, Type[] types)
So I'm wondering if I can somehow access and get private constructor in .NET Core.
Use TypeInfo.DeclaredConstructors.
According to documentation it applies to .NET Core 1.1 (and else).
You are expected to use GetTypeInfo().DeclaredConstructors and LINQ filter to find the desired constructor.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With