Introduction
C# 8 introduce switch expression, an elegant and compact new way to write switch statements.
It's important to note that the switch expression is not a replacement to the classic switch statement but it can be used in the majority of the situations. What you can do with the switch expression can always be done with a switch statement but not the opposite.
In this video, you will learn how you can convert a classic switch statement to the new syntax and the limitations of this new feature.
Practical Video
Conclusion
Honestly I think the switch expression is the best feature added to the C# 8 language. It's a feature that can greatly impact you code bases by making them easier to read. My recommendation is to always use switch expressions unless you hit a limitation and you are forced to rely on the old classic switch statement.
unable to see the video
It’s likely to be a cookie issue. Make sure you accept the necessary cookies when you get the cookie consent popup.