mirror of
https://github.com/adambard/learnxinyminutes-docs.git
synced 2024-12-23 17:41:41 +00:00
Merge pull request #2823 from ravinderjangra/NewLocalBranch
[csharp/en] C# 7 Feature Tuple
This commit is contained in:
commit
8f1586960f
@ -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
|
## Topics Not Covered
|
||||||
|
Loading…
Reference in New Issue
Block a user