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;
|
||||
}
|
||||
|
||||
@@ -0,0 +1,10 @@
|
||||
<Project Sdk="Microsoft.NET.Sdk">
|
||||
|
||||
<PropertyGroup>
|
||||
<OutputType>Exe</OutputType>
|
||||
<TargetFramework>net10.0</TargetFramework>
|
||||
<ImplicitUsings>enable</ImplicitUsings>
|
||||
<Nullable>enable</Nullable>
|
||||
</PropertyGroup>
|
||||
|
||||
</Project>
|
||||
Reference in New Issue
Block a user