Are you looking for a code refactoring tool? If so, check out ReSharper . This makes it easy to turn simple field properties into automatic properties and vice versa.
If you just donβt want to write your own properties with field support , you can use auto-properties , fpor example, like this:
public string MyProperty { get; set; }
which is equivalent to:
private string m_MyProperty; public string MyProperty { get { return m_MyProperty; } set { m_MyProperty = value; } }
You can even make the differences between the setter and getter accessible:
public string MyProperty { get; private set; }
If you decide to use automatic properties, keep in mind that you cannot access the base field, and you cannot implement the implementation for only one part (only for the recipient or only for the setter). However, you can make the property virtual.
Lbushkin
source share