I'm looking for the best approach for generating data transfer objects from business objects (the type definition, not mapping the data) using a set of conventions (e.g. all public properties), and possibly configurable to determine how deep to go.
I realize that this may not be possible or even desirable for many cases where the dto's don't resemble the business objects (such as when flattening a number of business objects into a single data transfer object).
However, in my case, a large percentage of my data transfer objects are very similar to their business objects (especially for the DTO's for updating the data).
I was wondering whether there are any existing code generation tools (I'm looking for specific solutions with existing templates, not just a general purpose code gen tool like CodeSmith), or dynamic assembly creation tools (e.g. using Reflection Emit under the covers)? Or if this is something you've done before I'd be interested to hear about what technique you used to help me decide between the various options.