¿Es posible declarar implícitamente próxima Dictionary<HyperLink, Anonymous>
:Anónimo inicializador de colección para un diccionario
{ urlA, new { Text = "TextA", Url = "UrlA" } },
{ urlB, new { Text = "TextB", Url = "UrlB" } }
así que podía usar de esta manera:
foreach (var k in dic)
{
k.Key.Text = k.Value.Text;
k.Key.NavigateUrl = k.Value.Url;
}
?
posible duplicado de [Un diccionario donde el valor es un tipo anónimo en C#] (http://stackoverflow.com/questions/1619518/a-dictionary-where-value-is-an-anonymous-type-in-c -sharp) – nawfal