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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 27, 20262026-05-27T02:05:31+00:00 2026-05-27T02:05:31+00:00

I have a linq query Context.Set<Entity>().where(x=>x.condition == true).select(x=> new ViewModel{Property = x.Property}); I would

  • 0

I have a linq query

Context.Set<Entity>().where(x=>x.condition == true).select(x=> new ViewModel{Property = x.Property});

I would like to be able to make a change to the linq query through something like this

Context.Set<Entity>().ChangeLinqQuery("String").where(x=>x.condition == true).select(x=> new ViewModel{Property = x.Property});

So that when I capture the DbCommandTree in my EFProviderWrapper I will be able to spot the change and capture the String. I also wish to be sure that the expression is applied to that particular reference to the Entity so that if I join the Entity on itself it will still be able to tell that that particular reference to Entity is the one I mean to alter.

The goal is to be able to alter the SQL generated by EF, so if you have a better means of achieving this goal please feel free to provide it.

  • 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-27T02:05:32+00:00Added an answer on May 27, 2026 at 2:05 am

    I don’t think this is possible. Your ChangeLinqQuery will have to add some custom expression into expression tree created on behind. The problem is that this expression tree is translated to ESQL – that is what DbCommandTree describes (it is not SQL). As I know ESQL is not extensible and so you cannot add any custom expressions to this process. Even if you could it would also most probably mean that you will have to rewrite much of SQL generation to satisfy your needs = not developing provider wrapper but provider itself.

    Your best choice with EF is simply replace table names in generated SQL which will be complex, slow and unless you build strong SQL parser following its syntax it will also be error prone.

    Your best choice is simply not using EF as I already recommended in your previous question.

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

Sidebar

Related Questions

I have an entity set of Publications with a ReleaseDate property. I would like
I have a LINQ to SQL query: from at in Context.Transaction select new {
I have a LINQ query mapped with the Entity Framework that looks something like
I have a Linq query that looks something like this: var myPosse = from
I have a Linq query that looks something like this: var query = from
I have a LINQ query that returns some object like this... var query =
Say I have a linq query select r in db.Roles where r.RoleName DOES NOT
I would Like to sort the keywords by its sort property. I have a
I have the following query in Linq: var query = from question in context.Questions.Include(QAnswers)
I have a LINQ query that looks like the following: DateTime today = DateTime.UtcNow;

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.