|
by skeet via Jon Skeet: Coding Blog on 1/9/2009 7:52:14 AM
One of the reasons I don't view anonymous types as being too bad is that they're nicely confined to methods. You can't declare the type that you're returning from a method if it's anonymous (or if one of its type arguments is generic, e.g. a List<T> where T is an anonymous type and T isn't a type parameter to the method itself). However, you can get around this if you're sneaky. I've always known that it's perfectly easy to return an instance of an anony
... [ read more ]
|