gpt4 book ai didi

c# - 这是什么 : new[] { }

转载 作者:行者123 更新时间:2023-11-30 18:58:53 25 4
gpt4 key购买 nike

<分区>

我正在尝试掌握 ASP MVC4,我在 .cshtml 文件中的 @{...} 中遇到了这个问题:

        @Html.DropDownListFor(x => x.WillAttend, new[] { 
new SelectListItem() {
Text = "Yes, I'll be there",
Value = bool.TrueString},
new SelectListItem() {
Text = "No, I can't come",
Value = bool.FalseString}
}, "Choose an option")

Q1) 这是什么东西:new[]{...}

Q2) 对于 razor,我说的对吗,大括号内的内容就是任何 C# 代码。

谢谢。

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