Selasa, 21 Desember 2010

Why are anonymous types generic?

Suppose you use an anonymous type in C#:var x = new { A = "hello", B = 123.456 };Ever taken a look at what code is generated for that thing? If you crack open the assembly with ILDASM or some other tool, you'll see this mess in the top-level type definitions .class '<>f__AnonymousType0`2'<'j__TPar','j__TPar'>What the heck? Let's clean that up a bit. We've mangled the names so that you are

Tidak ada komentar:

Posting Komentar