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

  • Home
  • SEARCH
  • 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 7624419
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 31, 20262026-05-31T04:57:35+00:00 2026-05-31T04:57:35+00:00

Is it possible to use a dynamic Linq Expression inside a Query Expression? Something

  • 0

Is it possible to use a dynamic Linq Expression inside a Query Expression?
Something like this:

from obj1 in ObjectSet1
let res = ObjectSet2.Where(* SomeExpression *)
where ...
select ...

I’m trying to build Expression.Lambda<Func<TSource, bool>> Expression as for SomeExpression.

  1. Is it possible to to use dynamic Linq Expression within the Expression Query or do I need to build the whole Expression tree from scratch?
  2. How can I, if any, use obj1 when I’m building SomeExpression?

Note: I’m using Entity Framework, I can’t use SomeExpression.Compile() within the expression tree.

  • 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-31T04:57:37+00:00Added an answer on May 31, 2026 at 4:57 am

    It’s not only possible, it’s normal. Large expression trees can be generated from smaller trees (this is what LINQ does). You only have to pass in an Expression<Func<TSource, bool>> to Where().

    You can see how in my reply to this other thread here – replacing operator in Where clause Lambda with a parameter . The interesting part is in the MakeWhereLambda method.

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

Sidebar

Related Questions

I would like to use enumerations in my dynamic LINQ queries. Is it possible,
Is it possible, to use a dynamic value inside a SELECT FROM sql command?
Can I use dynamic data type in WF 4.0? And if this is possible
How to process dynamic source code in C++? Is it possible to use something
Is it possible to use CTE in a WHERE clause e.g. SELECT * FROM
I have tried some ways to use LINQ dynamic queries - LINQKit and LINQ
Is there any way to use dynamic keys with the node-mongodb-native driver? By this
Is it possible to use a dynamic variable (not sure about naming) in C#?
is it possible in Android create dynamic layouts and then use them? I mean
I need to specify, that my member property will return something like dynamic? in

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.