是否可以将Visual Studio 2022中的快速操作菜单生成的完整属性的格式从当前的格式更改为:
public string Country { get => country; set => country = value; }
字符串
回到以前的样子:
public string Country
{
get
{
return country;
}
set
{
country = value;
}
}
型
我更倾向于后者。
是否可以将Visual Studio 2022中的快速操作菜单生成的完整属性的格式从当前的格式更改为:
public string Country { get => country; set => country = value; }
字符串
回到以前的样子:
public string Country
{
get
{
return country;
}
set
{
country = value;
}
}
型
我更倾向于后者。
1条答案
按热度按时间xghobddn1#
感谢wenbingen-MSFT的评论,我能够找到影响快速操作行为的设置,以便为字段生成属性。
对于其他任何可能想要更改此设置的人,请执行工具->选项->文本编辑器->C#->代码样式->常规->表达式首选项->使用表达式体作为访问器和属性
下图:x1c 0d1x