Visual Studio 2010!

Read now >

View Now
DevSource RSS FEEDS
XML Want an easy way to keep up with breaking tech news? And the Get DevSource headlines delivered to your desktop with RSS.
ADVERTISEMENT
ADVERTISEMENT

 

DevSource.com: Your Source for Visual Studio on Facebook
ADVERTISEMENT
Implementing Extension Methods in C#
By Paul Kimmel

Rate This Article: Add This Article To:

Implementing Extension Methods in C#
( Page 3 of 3 )

 

Summary

Extension methods are a fascinating and new aspect of .NET programming. Extension methods permit extending the behaviors of classes without inheritance which in some cases is impossible. For example, sealed classes cannot be inherited from. In this article a simple extension method that dumps an object’s state and another generic extension method that extends IDataReader were demonstrated.

On a side note extension methods are at the heart of the new technology, LINQ. Extension methods are the underpinnings for the ability to query enumerable objects. Check out my book LINQ Unleashed: for C# for a comprehensive examination of extension methods and LINQ.

Biography

Paul Kimmel is the VB Today columnist for HYPERLINK "http://www.codeguru.com/" \t "new" www.codeguru.com and has written several books on object-oriented programming and .NET. Check out his upcoming book LINQ Unleashed for C# due July 2008. Paul is an application architect for Electronic Data Systems in Lansing, Michigan. You may contact him for technology questions at pkimmel@softconcepts.com.

If you are interested in joining or sponsoring a .NET Users Group, check out www.glugnet.org. Glugnet opened a users group branch in Flint, Michigan in August 2007. If you are interested in attending, check out the www.glugnet.org web site for updates.



 
 
>>> More Microsoft Languages Articles          >>> More By Paul Kimmel