In mvc i can use construction like this
@Html.TextAreaFor(model => model.iEventSummary, new { @class = "test" })
I’m trying to reproduce this new { @class = "test" } as parameter but unsuccessfully
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;
}
How does a method variable must be declared?
If I want pass new {key1="value1", key2="value2", key3="" } as parameter.
1 Answer