How to Add Custom Rule to FXCop for avoiding == operator inside the method
- by Jameel
I want to add a Custom rule for avoiding the '==' operator inside a method in a class.
For example in the below method i need to avoid 'str1==str2' with string.Compare(str1, str2,StringComparison.Ordinal);.So I need to check this types of code are appear in any of the method
public void StringTest2()
{
string str1 = "Hello";
string str2 = "HELLO";
if (str1 == str2)
{
}
}