How do I use AutoMapper to populate back to a DataTable?
I'm using AutoMapper which is a great tool.
There's lots of examples converting from DataTable
/IDataRead
to DTO
's but I can't seem to find any that convert the DTO
back to a DataTable
.
Is this possible? I've tried various things, but I think there's some diff开发者_Python百科iculty with the creation of Row
s - as you can't new
them up.
Not right now out of the box. What you COULD do is create a new IObjectMapper. Take a look at the DataReaderMapper.cs in the source code (found on github), and build the opposite direction. If you get it to work, I'll gladly fold what you get back into the project, because it sounds like a really interesting idea.
I forked it in GIT; Jimmy Bogard may be looking to merge it in during the next major version.
You can get it here.
精彩评论