How to map a dataset and a typed dataset using Automapper?

I am trying to assign values ​​from Dataset (Dataset.Table (0)) to a typed dataset (XSD) and vice versa. Both my dataset.table (0) and the typed dataset have the same structure. I am trying to match between the two using Automapper, but I do not understand how to do this.

+3
source share
1 answer

It has been a long time since I used DataSets, but is it not for merging?

myds.Merge( ds );

I think there will be too many properties in the DataTable to ignore, etc., it will be a pain. You would do a comparison with two datarows, not with datasets.

It will be something like

.ForMember( trow => trow.MemberName, o => o.MapFrom( row => row["MemberName"] ) )

You are converting List of DataRows.

0

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


All Articles