in Uncategorized

Writing your first Extension Method

Dan Fernandez has a nice post on how to go about writing your first extension method in C# 3.0.

I liken the concept of extension methods to a variation of prototyped based programming where you can assign a new method to any type just by adding it to the prototype. It’s not 100% the same, but if you’re familiar with that concept it should help get the concept of extension methods across.

I also just attended a chat session on C#3.0 yesterday (transcript not yet available) where they mentioned they were considering how to do extension properties as well. That would be very interesting since that would involve adding arbitrary state to an object as well.

Leave a comment


  • Related Content by Tag