What\'s the best way to create a list with an arbitrary number of instances of the same object? i.e is there a more compact or efficient way to do the following?
<
Edited to reflect that this method does not work.
I was curious about your comment about Enumerable.Repeat, so I tried it.
Enumerable.Repeat
//do not use! List myList = Enumerable.Repeat(new object(), 100).ToList();
I confirmed that they do all share the same reference like the OP mentioned.