在 mvc 中,我可以使用这样的构造
@Html.TextAreaFor(model => model.iEventSummary, new { @class = "test" })
我正在尝试将此new { @class = "test" }
作为参数重现,但未成功
testFunction( new {key1="value1", key2="value2", key3="" })
public static string testFunction(dynamic dict)
{
string ret = string.Empty;
IDictionary<string, string> dictionary = dict;
foreach (var item in dictionary)
{
ret += item.Key + item.Value;
}
return ret;
}
必须如何声明方法变量?new {key1="value1", key2="value2", key3="" }
如果我想作为参数传递。