One of the biggest questions with Anonymous Types is “can I pass them around?” If not, why not? Can you do something like this, for example:
var GetAnonymousValue() {
return new { Name = “Richard Bushnell” };
}
void Main() {
var value = GetAnonymousValue();
var name = value.Name;}
The answer is simple: no, you can’t [...]
Lesen Sie den vollständigen Eintrag unter http://richardbushnell.net/index.php/2008/01/08/can-you-pass-an-anonymous-type-across-functions/