Resharper suggest to convert private method to private static method? what is the different and what is advantage? need some input here . it is C# code.
Asked
Active
Viewed 325 times
1 Answers
7
Private static is good when the method does not rely on the object's fields.
If it does, ReSharper doesn't suggest anything like that.
So when your method depends only on it's parameters, it's good to make it static.
A compiler can take advantage of such methods - it was explained somewhere here on SO.

Piotr Zierhoffer
- 5,005
- 1
- 38
- 59
-
Please don't answer when there are several identified applicable duplicates. Help us close the question and limit noise. If you have something to contribute, add it to the canonical duplicates. – Anthony Pegram Jun 14 '13 at 14:20
-
@user414076 - Hmm, you're probably right. I didn't look for dups because I think it's the user responsibility to do so - I just answer the question (not marked as duplicate then). I'd have to check meta for opinions on that matter :) – Piotr Zierhoffer Jun 14 '13 at 14:24