gpt4 book ai didi

visual-studio-2010 - 脚手架/在初始值设定项中生成对象的属性

转载 作者:行者123 更新时间:2023-12-04 21:47:51 31 4
gpt4 key购买 nike

有谁知道如何为所有对象属性“构建”或“生成”构造函数块?我有 VS2010 和 Resharper,我希望生成类似的东西:

    public Customer CustomerB = new Customer
{
firstName = "",
middleName = "",
lastName = "",
additionalPhone = "0",
address1 = "",
address2 = "",
birthDate = new DateTime(),
cellPhone = "",
city = "",
driverLicenseNumber = "",
driverLicenseState = "",
emailAddress = "",
country = "",
fax = "",
grossIncome = 0,
education = null,
leadRequest = null
};

然后我可以在那里加倍并填写空白可以这么说。我发现的一切都是 DatabaseFirst 和 Getter/Setters 类属性......

最佳答案

我认为不可能使用 VS 和 ReSharper 为所有属性生成对象初始值设定项。对于每个属性选择,您都需要按 Ctrl+Space。

关于visual-studio-2010 - 脚手架/在初始值设定项中生成对象的属性,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/11300940/

31 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com