Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 3602588
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 18, 20262026-05-18T20:45:54+00:00 2026-05-18T20:45:54+00:00

Finally, I have been able to get through reflection, a member of type Func<T,

  • 0

Finally, I have been able to get through reflection, a member of type Func<T, TResult>, now, how do I invoke it?

When I retrieve it, I do it through the Type.GetMembers method, and that returns a MemberInfo type that does not have a Invoke method; how can I invoke it?

Again people, thanks in advance! =)

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-18T20:45:54+00:00Added an answer on May 18, 2026 at 8:45 pm

    In order to get a delegate to the method you need to call MakeGenericMethod passing in the generic type arguments – this returns an invokable delegate:

    var constructedMethod 
        = yourMethodInfo.MakeGenericMethod(typeof(int), typeof(string));
    constructedMethod.Invoke(yourInstance, yourArguments);
    

    If you are curious, the reason you need to do this is because the MethodInfo instance you currently hold is open, meaning that no generic type arguments have been bound to it (and naturally this method cannot be invoked which is why there is no Invoke method available). By calling MakeGenericMethod you are explicitly constructing the method with generic type arguments.

    For reference – MakeGenericMethod:

    [Returns] a MethodInfo object that represents
    the constructed method formed by
    substituting the elements of
    typeArguments for the type parameters
    of the current generic method
    definition.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

In my implementation of Java NIO I have not been able to get SelectionKey.attach()
with great difficulty , I guess I have finally been able to find the
UPDATE: It Is Now Working I was able to finally get it completed. A
I have finally worked out how to get stdin and stdout to pipe between
I have finally managed to get javan-whenever gem working on my site5 server, and
I have been trying since yesterday to get google like paging, but each time
So I've been doing a lot of reading. And I have been able to
I have a silly problem i haven't been able to figure out. Can anyone
I'm new to NAnt and have been able to create a <target> which 1)
So I have been looking every where, and so far i haven't been able

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.