CSharpFeeds - All your C# feeds in one place.

Friday, January 09, 2009

Horrible grotty hack: returning an anonymous type instance

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 ]

Horrible grotty hack: returning an anonymous type instance

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 ]

Subscribe

New Feed

Product Spotlight

Recently Updated Sources

Legal Note

The content of the postings is owned by the respective author. CSharpFeeds is not responsible for the contents of the postings. This site is automatically generated and cannot be reviewed for abusive content. If you find abusive content on CSharpFeeds, please contact us. Designated trademarks and brands are the property of their respective owners. All rights reserved.

Advertise with us