"In your project file make sure the language version is set to preview since switch expressions are a new C# 8.0 feature." There's also a convert if statements to switch statements or switch ...