Method can be made static, but should it?

2018-12-31 20:00发布

Resharper likes to point out multiple functions per asp.net page that could be made static. Does it help me if I do make them static? Should I make them static and move them to a utility class?

13条回答
大哥的爱人
2楼-- · 2018-12-31 20:37

This is interesting read:

http://thecuttingledge.com/?p=57

ReSharper isn’t actually suggesting you make your method static. You should ask yourself why that method is in that class as opposed to, say, one of the classes that shows up in its signature...

but here is what resharper documentaion says: http://confluence.jetbrains.net/display/ReSharper/Member+can+be+made+static

查看更多
登录 后发表回答