I am new to C#. In Java, I can make read/write of a Java class member by having 'synchronized' keyword in the setter/getter method.
Can you please tell me what is the right way to do the same in C#? In C# there is no synchronized keyword. Should I use '[MethodImpl(MethodImplOptions.Synchronized)] annotation' mentioned in C# version of java's synchronized keyword??
Or use Monitor.Enter (and subsequently Monitor.Exit)?