How do you manage the namespaces of your extension methods?

Posted by Robert Harvey on Stack Overflow See other posts from Stack Overflow or by Robert Harvey
Published on 2010-03-26T00:34:36Z Indexed on 2010/03/26 0:43 UTC
Read the original article Hit count: 241

Filed under:
|

Do you use a global, catchall namespace for all of your extension methods, or do you put the extension methods in the same namespace as the class(es) they extend?

Or do you use some other method, like an application or library-specific namespace?

EDIT: I ask because I have a need to extend System.Security.Principal.IIdentity, and putting the extension method in the System.Security.Principal namespace seems to make sense, but I've never seen it done this way.

© Stack Overflow or respective owner

Related posts about c#

Related posts about extension-methods