Do you think it's better to always make protected class members an auto-implemented protected property to keep isolation or make it protected field is enough?
protected bool test { get; set; }
or
protected bool test;
Do you think it's better to always make protected class members an auto-implemented protected property to keep isolation or make it protected field is enough?
protected bool test { get; set; }
or
protected bool test;
Generally, you should use autoproperties - this allow you to easily add verification, or anything else you need later on. This is especially important if the protected member will be used by classes outside your assembly, as adding such code won't break your contract with them, whereas changing a field to a method or property will.
property, backed by a private field.
This question might be useful
The suggested practice is to make it a property. The signature changes depending on whether it's a field or a property, which can cause problems if you're crossing assemblies. If you make it a property to begin with, you'll never have this problem. (often later you want to add logic when the property is read or written.)
In C#, auto-implementing the property is so easy, there's no reason not to do it.
Also, it makes things more clear. If it is really meant to be used by the outside world as part of the functioning of the object, make it a property. Otherwise, a future programmer might wonder if you made a field protected instead of private by accident.
You should never allow direct access to a member variable from outside your class. Either use an auto-generated property or a property with a backing field. If you allow direct access, it can lead to some really bad debugging headaches when multiple methods change that value in a derivation chain and you don't know which one is causing the bug.