From 4ee29d1c256c7587457469da2415ed8997e983e5 Mon Sep 17 00:00:00 2001 From: Ravinder Jangra Date: Thu, 10 Aug 2017 11:22:43 +0530 Subject: C# 7 Feature Tuple --- csharp.html.markdown | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) (limited to 'csharp.html.markdown') 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 -- cgit v1.2.3