https://learn.microsoft.com/zh-cn/dotnet/csharp/language-reference/operators/switch-expression
[DisplayName("空气质量指数颜色")]
public string TvocColor => AQI switch
{
1 => "green",
2 => "yellow",
3 => "orange",
4 => "red",
5 => "purple",
6 => "brown",
_ => "green",
};
[DisplayName("空气质量指数评级")]
public string TvocLevel => AQI switch
{
<= 3 => "优",
<= 7 => "良",
>= 8 => "差",
_ => "优",
};
标签:DisplayName,C#,switch,AQI,public,表达式
From: https://www.cnblogs.com/densen2014/p/17777978.html