开发者

How to map Dataset and Typed Dataset using Automapper?

开发者 https://www.devze.com 2023-01-12 14:34 出处:网络
I am trying to assign values from Dataset(Dataset.Table(0)) to a Typed Dataset(XSD) and vice verse. And my dataset.table(0) and type开发者_运维问答d dataset has same structure. I am trying to map betw

I am trying to assign values from Dataset(Dataset.Table(0)) to a Typed Dataset(XSD) and vice verse. And my dataset.table(0) and type开发者_运维问答d dataset has same structure. I am trying to map between this two using Automapper but i am not getting how to do that one.


It's been a long time since I have used DataSets but isn't this what Merge is for?

myds.Merge( ds );

I think there will be too many properties on the DataTable to have to ignore etc it will be a pain. You would do the mapping from the two datarows not the datasets.

It would be something like

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

You would convert the List of DataRows.

0

精彩评论

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