PI06 i PI06-1. Docker definitions for MSSQL and Postgres. Data seeder/generator for countries and people. Entity Framework example with variants for Postgres and MSSQL
This commit is contained in:
22
SomeOfCSharpFeatures/ValueTuplesDeconstruction/Program.cs
Normal file
22
SomeOfCSharpFeatures/ValueTuplesDeconstruction/Program.cs
Normal file
@@ -0,0 +1,22 @@
|
||||
//ValueTuples https://docs.microsoft.com/en-us/dotnet/csharp/fundamentals/functional/deconstruct
|
||||
|
||||
(int a, int b, int _) t1 = CreateRandomTriple();
|
||||
Console.WriteLine(t1);
|
||||
Console.WriteLine(t1.b);
|
||||
|
||||
var (_, b, _) = CreateRandomTriple();
|
||||
Console.WriteLine(b);
|
||||
|
||||
|
||||
var t2 = CreateRandomTriple();
|
||||
Console.WriteLine(t2);
|
||||
Console.WriteLine(t2.Item2);
|
||||
|
||||
(int, int, int) CreateRandomTriple()
|
||||
{
|
||||
Random r = new Random();
|
||||
var triple = (r.Next(100), r.Next(100), r.Next(100));
|
||||
Console.WriteLine($"Created {triple}");
|
||||
return triple;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user