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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 19, 20262026-05-19T11:31:15+00:00 2026-05-19T11:31:15+00:00

Does LINQ actually perform a deep copy of the results to a different list/array/etc,

  • 0

Does LINQ actually perform a deep copy of the results to a different list/array/etc, or does it simply give me a list/array/etc. composed of references to the original?

  • 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-19T11:31:15+00:00Added an answer on May 19, 2026 at 11:31 am

    It’s going to depend on if (and how) you use Select to project the results.

    If you do not create new objects in a projection then the result will reference the same objects as the original collection.

    If, however, you create new objects in the project then, obviously, they will not be the same.

    The collection returned here will contain references to the same objects in _myCollection:

    from m in _myCollection
    where m.SomeFilterCriteria
    select m
    

    The collections returned in these cases will not:

    from m in _myCollection
    where m.SomeFilterCriteria
    select new { m.Prop1, m.Prop2 }
    

    In this case, it is worth pointing out that Prop1 and Prop2 of the new anonymous object – if they are reference types – will contain a reference to the same object as the original object. Only the top-level references in the collection will be different.

    Basically – nothing in .Net aside from serializers (as mentioned elsewhere here) will “deep” copy, unless you implement it.

    or

    from m in _myCollection
    where m.SomeFilterCriteria
    select m.Clone()
    

    Again, it would be a mistake to assume that any “deep” copying is going on here. Of course, Clone‘s implementation will be in the class and could be anything, including deep copying, but that is not given.

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

Sidebar

Related Questions

What does it actually mean by the term Entity in LINQ? What is the
Does anyone know of a definitive list of LINQ to SQL query limitations that
Does LINQ and Lambda expressions reduce cyclomatic-complexity? Just curious because CodeRush actually shows a
Does LINQ to SQL work in connected environment or disconnected environment? I mean if
In another posting: Does Linq-To-Sql support composable queries there was discussion on how to
With LINQ To SQL, how/when does the process map your object/entity to your table?
Any ideas why does the entity framework in LINQ gives following strange error: Unable
LINQ simplifies database programming no doubt, but does it have a downside? Inline SQL
I have written a LINQ to XML query that does what I want, but
I want to write a LINQ to Entity query which does order by ascending

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.