I have a property in my class that has a lot of logic in set accessor:
private String text;
public String Text
{
get { return text; }
private set
{
// some actions with a value
value = value.Replace('a', 'b');
text = value;
}
}
How can I prevent other developers (or even me) from changing field instead of property inside of this class ?
If somebody writes something like this:
public Test(String text)
{
this.text = text;
}
it will break the logic of my class !