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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 26, 20262026-05-26T01:22:45+00:00 2026-05-26T01:22:45+00:00

Normally I can query an entity context using linq in the typical way, IQueryable<Product>

  • 0

Normally I can query an entity context using linq in the typical way,

IQueryable<Product> query = from p in db.Products
                            where p.ProductID > 1
                            select query;

Now say I wanted to get the expression of this IQueryable, serialize it, and pass it over the wire to be reconstructed on the other end,

Expression ex = query.Expression;

XElement xExpression = serializer.Serialize(ex); 

wcfClient.InvokeSomeServiceMethod(xExpression);

How would I reconstruct this on the other end? (the server end, to be specific)

I need to create a new instance of IQueryable and ‘set’ the expression used by the underlying provider by actually passing in an Expression instance, is this possible? There is no setter on IQueryable by default, of course. More specifically I just need an ObjectQuery so I can call ToTraceString() and get the entity sql on the other end. I cant seem to find any point where I can inject the Expression directly.

Thanks.

  • 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-26T01:22:46+00:00Added an answer on May 26, 2026 at 1:22 am

    I would suggest you look at InterLINQ. It provides the ability to serialize an expression and transmit over WCF.

    I’m using it with NHibernate to achieve a similar outcome to what you’re describing and it seems to work well. (There’s a bit to get your head around though, so as others have suggested, WCF Data Services / OData would be be quicker/easier).

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

Sidebar

Related Questions

How can I display data in two columns? <?php $query = SELECT * FROM
Normally you can do this: <select size=3> <option>blah</option> <option>blah</option> <option>blah</option> </select> And it would
A user can import data into our website from a file. The data normally
I have an MDX query that retrieves data from an SSAS 2005 cube: SELECT
Normally you can add a query as a new data source in Cognos PowerPlay
I have a query to the effect of SELECT t3.id, a,bunch,of,other,stuff FROM t1, t2,
Possible Duplicate: Can select * usage ever be justified? Curious to hear this from
Using JQuery, I'm extracting the value from what is essentially a query box for
Regarding this line database::query(DELETE FROM bo WHERE name='{$this->_protected_arr[a1]}' AND email='$_SESSION[email]'); How can I update
If I have an entity framework 4 context, normally if I have run a

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.