C# Compiler Error – CS8523 the discard pattern is not permitted as

In this blog post, you’ll learn more about the C# Compiler Error – CS8523 and the related message description

C# Compiler Error Code

CS8523

C# Compiler Description for the Code :CS8523

The discard pattern is not permitted as a case label in a switch statement. Use ‘case var :’ for a discard pattern, or ‘case @:’ for a constant named ‘_’.