Are there any tools that can generate classes from anonymous types?
I have a complex data structure that I have created using anonymous types. I would like to use this data structure in other places where the anonymous type would be out of scope. That’s why I’m looking for such a code generation tool.
That’s one of the refactorings supported by Resharper. With nested anonymous types (where one anonymous type has properties of another anonymous type), you’ll just have to convert the inner types before you get the option to convert the outer one.