mirror of
https://github.com/adambard/learnxinyminutes-docs.git
synced 2024-12-23 09:41:36 +00:00
C# 7 Feature Tuple
This commit is contained in:
parent
6e7c5c7933
commit
4ee29d1c25
@ -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
|
||||
|
Loading…
Reference in New Issue
Block a user