c# - Unable to find private void generic function with GetMethod -
i have function following signature:
private void foo<tpoco>(icontext context, list<tpoco> pocos, datetime modifieddatetime) tpoco : myabstractclass
and cannot find function in getmethods().
based on post ( getmethod generic method ), have tried these binding flags:
gettype().getmethods(bindingflags.public | bindingflags.nonpublic | bindingflags.instance | bindingflags.static | bindingflags.flattenhierarchy )
and finds 14 other methods in class, not one. does find method:
protected void bar<tcontext, tpoco>(list<tpoco> pocostopersist, tcontext context) tcontext : icontext, new() tpoco : myabstractclass
so difference access level - can see other private functions.
even if change binding flags simpler (which, understand, shouldn't make new items visible):
gettype().getmethods(bindingflags.nonpublic | bindingflags.instance )
i still don't see function.
as comments on post point out, code should have worked. issue class defining function in abstract, wasn't able find private function.
if this.gettype().basetype.getmethods( bindingflags.nonpublic | bindingflags.instance)
, function shows expected.
Comments
Post a Comment