CS301_05_01 – Extension Methods

In this video we’ll talk about extension methods which are simply methods — usually helper methods that can be bolted on to the side of existing types / classes … even if that type is sealed, meaning that it cannot be inherited from. In the past you may have had some helper methods that are intended for operation on certain types … like a formatting method for example. This is similar in concept, but the implementation is cleaner and more elegant. The reason why Extension MEthods are important is because this is how LINQ’s methods, like Select, Where, Sum, Count, are bolted on to the side of types that implement the IEnumerable interface, as well as others. So, Extension Methods are what makes LINQ’s method syntax work.

« Previous LessonC# 301 – C# 3.0 Language EnhancementsNext Lesson »

This ship has sailed …

This webpage describes one video of hundreds hosted on this website. HOWEVER …

This video has been removed from our collection.

Read why I decided to keep old pages like this around. Or better yet, visit the home page … its the best place to get started.

About this video:

Duration: 8 Minutes, 36 Seconds
Recorded Using: Visual Studio 2008 (all versions)


10 Year Anniversary Sale - 30% Off - ENDING SOON!!!    Learn more ...