Geeks With Blogs
Łukasz Kuryło's blog October 2010 Entries
Implementing custom ValueResolver for mapping with AutoMapper
AutoMapper is very useful and flexible tool. Using it we can avoid writing stupic mapping code for each entity to it's DTO representation to send it e.g. throught web service. If entity and dto object are mapping 1:1, there what we need to do is only write two lines of code: Mapper.CreateMap<Article, ArticleDTO>(); //e.g. in Global.asax and var result=Mapper.Map<Article, ArticleDTO>(article); It's not important, if Article class have ten or tousand fields. That's all. Think how horrible ......

Posted On Sunday, October 17, 2010 7:07 PM

Copyright © Łukasz Kuryło | Powered by: GeeksWithBlogs.net