Clean way of adding elements to IEnumerable
Is there a good way of adding an element to an IEnumerable without having to create a copy of the collection as such?:
What I want to do is something like this:
But ToList() makes a copy of the IEnumerable cats, and CatB is placed into the copy, instead of the IEnumerable cats.
What I want to do is something like this:
But ToList() makes a copy of the IEnumerable cats, and CatB is placed into the copy, instead of the IEnumerable cats.
