Tagged Questions
5
votes
5answers
291 views
Using a SetProperty method to prevent accidental changes to a property
Is it good/bad practice to do the following:
public class MyClass {
public MyType MyProperty { get; private set; }
public void SetMyProperty(MyType myProperty) {
MyProperty = myProperty;
}
...