Skip to content

Instantly share code, notes, and snippets.

@alastairs
Created September 15, 2011 16:04
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save alastairs/1219663 to your computer and use it in GitHub Desktop.
Save alastairs/1219663 to your computer and use it in GitHub Desktop.
Initialise a collection to an extension of another collection
private static readonly IEnumerable<Foo> BaseCollectionOfFoo = new List<Foo>
{
new Foo(1),
new Foo(2),
new Foo(3)
};
private static readonly IEnumerable<Foo> AllFoo = new List<Foo>(BaseCollectionOfFoo)
{
new Foo(4)
};
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment