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

后端 未结 10 1017
南方客
南方客 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:10

    @Juri- If you think about it this is the same problem as developers knowing that class X exists in the .NET framework. Communication is key that all team members use the right classes, be they extension methods or some other helper.

    As JP has stated, I often see extension methods in some kind of subfolder called Extensions. Hopefully when you state you use my.company.web.utils the namespace is actually Pascal cased?

    Even if you put them in a good place there is no 100% guarantee that other developers will use them.

提交回复
热议问题