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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 5, 20262026-06-05T01:48:58+00:00 2026-06-05T01:48:58+00:00

I am looking at some EF examples and trying to decipher what ‘Query Projection’

  • 0

I am looking at some EF examples and trying to decipher what ‘Query Projection’ exactly equates to when doing LINQ to Entities or EntitySQL. I believe it is when the query results are filtered and projected into an anonymous type but not 100% sure.

Can someone please define this and maybe provide a small L2E query that uses an example of 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-06-05T01:48:59+00:00Added an answer on June 5, 2026 at 1:48 am

    Projection is when the result of a query is output to a different type than the one queried. Another article defined it as : the process of transforming the results of a query

    Projection can be to an anonymous type, but could also be to a concrete type. If you come from a SQL world, it is akin to the columns listed in your SELECT clause.

    Example selecting a sub-set of an object into an concrete type:

    ParentObj.Select(x=> new ParentSlim { ParentID = x.ParentID,  Name = x.Name } );
    

    .
    Example merging to object into a 3rd anonymous type:
    Note: the select new portion is the projection.

    from P in ParentObj.AsQueryable()
    join C in ChildObj.AsQueryable() on P.ParentID == C.ParentID
    
    select new {                              // <-- look ma, i'm projecting!
                   ParentID = P.ParentID,
                   Name     = P.Name,
                   SubName  = C.Name
                   RandomDate = DateTime.UtcNow()
             }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Looking at some examples, I came across lines like: output.safe_concat(<input type=\hidden\ id=\#{k}\ name=\#{CGI.escape(k)}\ value=\#{CGI.escape(v)}\/>)
I'm looking for some examples for creating a custom constructor on my models. I
I am looking for some examples on storing some data into Google cloud storage
I'm looking for some good/proven examples of UI designs for a time entry system
I am looking for some docs and/or examples for the new JSON functions in
Looking at examples and tutorials for some MVC libraries for web development on the
Looking at examples about socket programming, we can see that some people use AF_INET
I am new to XML and have been trying some simple examples and they
I am looking for some code examples of a local java program that communicates
I'm looking for some basic examples of the python 2.7 unittest setUpClass() method. I'm

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.