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 9013665
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 16, 20262026-06-16T03:19:31+00:00 2026-06-16T03:19:31+00:00

How does one use Type.GetMethod() to get a method with lambda parameters? I’m trying

  • 0

How does one use Type.GetMethod() to get a method with lambda parameters? I’m trying to get the Queryable.Any method for a parameter of something like Func, using this:

typeof(Queryable).GetMethod("Any", new Type[]{typeof(Func<ObjType, bool>)})

but it keeps returning null.

  • 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-06-16T03:19:32+00:00Added an answer on June 16, 2026 at 3:19 am

    There are four things wrong:

    • There’s no such thing as a “lambda parameter”. Lambda expressions are often used to provide arguments to methods, but they’re converted into delegates or expression trees
    • You’ve missed off the first parameter of Queryable.Any – the IQueryable<T>
    • You’re using Func<ObjType, bool> which is a delegate type, instead of Expression<Func<ObjType, bool>> which is an expression tree type
    • You can’t get at generic methods in quite that way, unfortunately.

    You want:

    var generic = typeof(Queryable).GetMethods()
                                   .Where(m => m.Name == "Any")
                                   .Where(m => m.GetParameters().Length == 2)
                                   .Single();
    var constructed = generic.MakeGenericMethod(typeof(ObjType));
    

    That should get you the relevant Any method. It’s not clear what you’re then going to do with it.

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

Sidebar

Related Questions

How does one use boost::spirit with an input that consists of something other than
How does one use binary data (BLOB type column) in SQLAlchemy. I just created
How does one use rm to delete a file named '--help'? When I try,
How does one use multiprocessing to tackle embarrassingly parallel problems ? Embarassingly parallel problems
how does one use code to do this: produce 15 random numbers [EDIT: from
How does one use the CGRectIntegral function? I understand it's purpose. The documentation isn't
It does not seem that SendGrid has a free account that one could use
In .net, does a bool[] use one bit or one byte per array item?
I usually use C type casting in C/C++ code. My question is, does adding
In Scala, how does one define a local parameter in the primary constructor of

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.