mardi 28 août 2018

Can I get private constructor in .NET Core?

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.





Aucun commentaire:

Enregistrer un commentaire