If you want people to use your extension methods…

… you need to make them discoverable. That means temporarily abandoning your solution-structure-based namespaces and placing them directly in the namespace of the class you are extending so it comes up in intellisense immediately. Even if it’s from a totally different library, or System.* itself.

namespace YourCompany.Common.Extensions
{
    // don't expect anyone to find this here
    public static class LinqExtensions { ... }
}

namespace System.Linq // can't miss it!
{
    public static class LinqExtensions { ... }
}
April 2, 2010

2 Comments

mike nelson on May 13, 2010 at 7:16 am.

Ah yes! Good idea!! Why didn’t I think of that…?

Leave Your Comment

Your email will not be published or shared. Required fields are marked *

*

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>