/*
A small example of the new Switch Expression in .NET 5
You find more details on:
https://docs.microsoft.com/en-us/dotnet/csharp/language-reference/operators/switch-expression
*/
using System;
public class Program
{
public static void Main()
var yourCar = "Aston Martin";
var youAre = yourCar switch
"VW Golf" => "boring",
"Porsche" => "fast",
"Aston Martin" => "amazing",
_ => "neutral/unknown"
};
Console.WriteLine($"You drive a {youAre} car.");
}