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: ...
Get Visual Basic® 2010 Unleashed now with the O’Reilly learning platform.
O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.