Best practices: C# Extension methods namespace and promoting extension methods

后端 未结 10 1016
南方客
南方客 2021-02-02 06:43

I know there exists already a post, describing nearly the same, but I think mine is a bit different.

What I would like to know is how you organize your extension methods

10条回答
  •  遥遥无期
    2021-02-02 07:18

    We put everything into the same Namespace and Class, however we use partial classes to keep them organized.

    For example:

    ExtensionMethods-String.cs

    ExtensionMethods-DataObject.cs

    ExtensionMethods-Debug.cs

    ...etc all have partial classes...

提交回复
热议问题