2 posts tagged with "csharp"

View All Tags

Fun with IEnumerable and collection initializers

Jaco Jansen van Vuuren

Jaco Jansen van Vuuren

Software Developer

IEnumerable and collection initializers. You probably use them every day (if you write C# code at least) without thinking about the implementation details too much. And honestly - neither did I. But after I got a null reference exception (by accident, of course) whilst doing an assignment to a collection I was reminded about some of the interesting parts of IEnumerable - and some of the fun stuff you can do with it.