Now, we move on to where extension methods are used the most, enumerated types. In an article by Eric Lippert, a principal developer on the C# team; LINQ was the reason extension methods were created in the first place. In this recipe, we will look at writing our own extension methods for the
IList type and take a look at an existing extension method in the .NET framework from the LINQ namespace.
Refer to the
IListExtensions.cs file in the
ExtensionMethods.Library project for the extension methods. These methods are used in the
IEnumerableExtensionTests.cs file in the
The following code snippet ...