What I want to do is pass IEnumerable to the method and return an IEnumerable instance to it. However, I want each collection to be a copy, and not just a copy that is a copy.
Example:
var data = (from p in sourceData
select new
{
a = 1,
b = "hello",
}).ToArray();
var dataCopy = data.Copy();
foreach (var d in dataCopy)
{
d.b = d.b + "1";
}
var finalData = data.Union(dataCopy);
Thus, the collection 'finalData' has twice as many elements as 'data' or 'dataCopy'. Thus, all parameters βbβ in βdataCopyβ are added to the end, but since they still refer to objects in βdataβ, all parameters βbβ in βdataβ also have β1β added to the end.
, "" , BinaryFormatter, . Activator.CreateInstance, .
, , , Serializable, , , , ...
, - ? :
var data = (from p in sourceData
select new SomeSortOfAnonymousTypeReplacement(new
{
a = 1,
b = "hello",
})).ToArray();
?