Skip to content

[Reflection] How do I convert my MethodInfo definition to a MethodInfo where the declaring type is a generic type instance? #99591

Answered by MichalStrehovsky
slxdy asked this question in Q&A
Discussion options

You must be logged in to vote
var genInstanceMet = (MethodInfo)typeof(GenericT<string>).GetMemberWithSameMetadataDefinitionAs(method);

Replies: 2 comments 7 replies

Comment options

You must be logged in to vote
1 reply
@MichalStrehovsky
Comment options

Comment options

You must be logged in to vote
6 replies
@MichalStrehovsky
Comment options

@slxdy
Comment options

@MichalStrehovsky
Comment options

@slxdy
Comment options

@slxdy
Comment options

Answer selected by slxdy
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
3 participants