mercredi 15 avril 2020

Reflection, static class, and extension methods [duplicate]

I was hoping someone can point me in the right direction. I haven't been able to find much info on this but is there a way using to use Reflecton to invoke a Extension method that is tied to a static class and the method is static? To clarify, the object that the Extension method extends off of, the property/object is declared as static and the class the property/object is also declare as static.

    public static class Foo
    {
        public static long a { get; }
    }

    public static class FooExtensions
    {
        public static void MyExtensionMethod(this long l)
        {
            // do extension work
        }
    }




Aucun commentaire:

Enregistrer un commentaire