(open, WaterGateOpen, WaterLevel) switch
{
(false ,false ,WaterLevel.High ) => false,
(false ,false ,WaterLevel.Low ) => false,
(false ,true ,WaterLevel.High ) => false,
(false ,true ,WaterLevel.Low ) => false,
(true ,false ,WaterLevel.High ) => true,
(true ,false ,WaterLevel.Low ) => throw new InvalidOptions(),
(true ,true ,WaterLevel.Low ) => true,
(true ,true ,WaterLevel.Low ) => false,
}
vehicle switch
{
Car c => 2.00m,
Taxi t => 3.50m,
Bus b => 5.00m,
Truck t => 10.00,
{ } => throw new ArgumentExeption(message: "Unknown vehicle", paramName: nameof(vehicle)),
null => throw new ArgumentNullException(nameof(vehicle))
};
if (employee.Tax is double and >= 10) ...
if (employee.Tax is (10 or 20) and int tax) ...