"Switch Expressions with Deconstruction"

// For sake of example, imagine User has a method declared with the signature:
// "public void Deconstruct(out int lastAppraisalRating, out bool isOverEighteen)"

var salary = user switch {
	Manager m when m.ManagerialLevel is ManagerialLevel.CLevel => 100_000,
	Manager m when m.ManagerialLevel is ManagerialLevel.UpperManagement => 70_000,
	Manager => 50_000,
	User (10, true) => 45_000, // Users with a 10/10 rating who are also over 18 get 45,000 
	User (9, true) => 40_000, // Users with a 9/10 rating who are also over 18 get 40,000 
	User (8, true) => 35_000, // Users with an 8/10 rating who are also over 18 get 35,000
	_ => 30_000
};


Code snippet taken from "Two Decades of C#: A Reference - C# 8".