Properties in C#

Properties in C#: Fields vs Properties, Auto-Properties and Read-Only Properties, Methods on a Class.

Updated

  1. Fields vs Properties (Apprentice): A property looks like a field from outside but runs code inside, so a class can let others read and set a value while it checks every change.
  2. Auto-Properties and Read-Only Properties (Apprentice): Write short auto-properties, make a property read-only to the outside with private set or get-only, and calculate a property from others.
  3. Methods on a Class (Apprentice): Write instance methods that use and change an object's state safely, keep its rules inside the class, and know when a method should be static.