How to use AutoMapper to populate back into a DataTable?

I use AutoMapper, which is a great tool.

There are many examples converted from DataTable / IDataRead to DTO , but I can not find something that converts DTO back to DataTable .

Is it possible? I tried different things, but I think there are some difficulties with creating Row - since you cannot new them.

+4
source share
2 answers

I forked it in git; Jimmy Bogard may try to combine it in the next major version.

You can get it here .

+2
source

Not now, out of the box. What you PRAY is to create a new IObjectMapper. Take a look at DataReaderMapper.cs in the source code (on github) and create the opposite direction. If you earn it, I will gladly hide the fact that you will return to the project, because it sounds like a really interesting idea.

+3
source

Source: https://habr.com/ru/post/1313872/


All Articles