Q:

C# List Take by value instead of by reference

I'm having an issue where if I "Take" from a list of strings, it is taking references to those values, so when I go to remove them from the original list, they are also removed from my "taken list".  Is there a way to TAKE by value from a list instead of by reference?  See code below.  
// ids is a list of strings, use example: ["123","456","789"]
var chunkIds = ids.Take(10);

// right here, chunkIds = ["123","456","789"]

ids.RemoveRange(0, ids.Count < 10? ids.Count : 10);
// after remove the elements we just took from the original list, chunkIds = []
// I want chunkIds to be ["123","456","789"], and ids should be []

I'm not seeing any way to do this in the docs (or I'm blind):
https://docs.microsoft.com/en-us/dotnet/api/system.linq.enumerable.take?view=netframework-4.8

A:

Take method (as many other Linq methods) is working using deferred execution, you are modifying the source sequence. To make your snippet working you have to convert the IEnumerable to List or Array (to get a new sequence), like that
var chunkIds = ids.Take(10).ToList();
...

Then you'll be able to remove the values from chunkIds without affecting the source ids sequence

