从 AutoMapper 到 Emit Mapper
我最近发现 AutoMapper 用于桥接 ViewModel 和我的实际数据库对象。我按照此处描述的方式使用它: http://automapper.codeplex.com/ wikipage?title=Projection&referringTitle=Home
我发现了 Emit Mapper :),但我找不到任何类似的内容(我可以在其中指定自定义投影规则):
.ForMember(dest => dest.EventDate, opt => opt.MapFrom(src => src.EventDate.Date))
提前致谢!
I've recently discovered AutoMapper for bridging ViewModels and my actual DB objects. I use it in the way decribed here: http://automapper.codeplex.com/wikipage?title=Projection&referringTitle=Home
I've discovered Emit Mapper to :), but I can't find anytning similar to (where I can specify custom projecting rules):
.ForMember(dest => dest.EventDate, opt => opt.MapFrom(src => src.EventDate.Date))
Thanks in advance!
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
根据记录,这是我遇到的关于如何执行此操作的最佳解决方案:
http://emitmapper.codeplex .com/discussions/259655
检查上一篇文章的解决方案。效果非常好。
更新:供将来参考的代码:
For the Record this is the best solution that I came across on how to do it:
http://emitmapper.codeplex.com/discussions/259655
Check the solution on the last post. It works really well.
Update: The code for future reference: