Extension Methods
Extension methods are a feature that Visual Basic 2010 inherits from its predecessor. As for other features discussed in this chapter, their main purpose is being used with LINQ, although they can also be useful in hundreds of different scenarios. Basically extension methods are special methods that can extend the data type they are applied to. The most important thing is that you can extend existing types even if you do not have the source code and without the need to rebuild class libraries that expose types you go to extend—and this is important. For example, you can extend .NET built-in types, as you see in this section, although you do not have .NET source code. We now discuss extension methods in two different perspectives: ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Read now
Unlock full access