My first time posting! Long time lurker.
I'm creating a static class, and this answer was very helpful: C# - Winforms - Global Variables
Here's the code from that answer for clarity:
static class Global
{
private static string _globalVar = "";
public static string GlobalVar
{
get { return _globalVar; }
set { _globalVar = value; }
}
}
However, in the process, ReSharper has recommended the code changes to this:
public static string value1 { get; set; } = "";
public static string value2 { get; set; } = "";
I don't think there's any difference, but I want to be 100% certain.
So my question is, is there any difference between the two, and if so, which one is the most desirable?