summaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorRavinder Jangra <ravinderjangra@live.com>2017-08-10 11:22:43 +0530
committerRavinder Jangra <ravinderjangra@live.com>2017-08-10 11:22:43 +0530
commit4ee29d1c256c7587457469da2415ed8997e983e5 (patch)
treef6ba02af189848adef16492d95c3079d4f1dbe77
parent6e7c5c793327f4a63b13e555894597915ca91fda (diff)
C# 7 Feature Tuple
-rw-r--r--csharp.html.markdown22
1 files changed, 22 insertions, 0 deletions
diff --git a/csharp.html.markdown b/csharp.html.markdown
index cca99fb0..a92f5aa2 100644
--- a/csharp.html.markdown
+++ b/csharp.html.markdown
@@ -1095,6 +1095,28 @@ namespace Learning.More.CSharp
}
}
}
+
+using System;
+namespace Csharp7
+{
+ //New C# 7 Feature
+ //Install Microsoft.Net.Compilers Latest from Nuget
+ //Install System.ValueTuple Latest from Nuget
+ class Program
+ {
+ static void Main(string[] args)
+ {
+ //Type 1 Declaration
+ (string FirstName, string LastName) names1 = ("Peter", "Parker");
+ Console.WriteLine(names1.FirstName);
+
+ //Type 2 Declaration
+ var names2 = (First:"Peter", Last:"Parker");
+ Console.WriteLine(names2.Last);
+ }
+ }
+}
+
```
## Topics Not Covered