开发者

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 Rows - 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.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜