summaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
-rw-r--r--csharp.html.markdown4
1 files changed, 4 insertions, 0 deletions
diff --git a/csharp.html.markdown b/csharp.html.markdown
index 2cacfc00..442700a6 100644
--- a/csharp.html.markdown
+++ b/csharp.html.markdown
@@ -671,6 +671,10 @@ on a new line! ""Wow!"", the masses cried";
int _speed; // Everything is private by default: Only accessible from within this class.
// can also use keyword private
public string Name { get; set; }
+
+ // Properties also have a special syntax for when you want a readonly property
+ // that simply returns the result of an expression
+ public string LongName => Name + " " + _speed + " speed";
// Enum is a value type that consists of a set of named constants
// It is really just mapping a name to a value (an int, unless specified otherwise).