Simple Convention Automapper for two-way Mapping (Entities to/from ViewModels)

后端 未结 4 432
[愿得一人]
[愿得一人] 2021-02-01 11:46

UPDATE: this stuff has evolved into a nice project, see it at http://valueinjecter.codeplex.com


check this out, I just wrote a simple automapper, it takes
4条回答
  •  攒了一身酷
    2021-02-01 12:07

    One thing you might want to add is to cache the reflection bits. If you map an object twice, you probably don't want to look up all the reflection stuff again. Also, things like GetValue and SetValue are quite slow, I switched to late-bound delegates + Reflection.Emit to speed things up.

提交回复
热议问题