By designing your code for functional composition, you can keep it simple and targeted, making it easier to implement, understand, and test it. More sophisticated logic can be modeled by composing various building blocks of basic functionality — extension methods for collections, in the case of this post.
The Enumerable class contains some lesser-known static members. Here's an overview over the Empty, Range, and Repeat methods.
I've created a NuGet package for my ExtraLINQ project. Go grab it!
When I used the Enumerable.Except extension method, its behavior startled me. It creates a set difference, which might not be what you expected. We'll take a look at how Enumerable.Except is implemented in the .NET Framework.
I've written a library called ExtraLINQ, which provides additional extension methods for working with .NET collections.