There are many reasons not to use AutoMapper in projects. I started to use AutoMapper about five years ago and the first problem that I encountered from the start gate was that using Automapper creates mapping code which is very difficult, and at times impossible to debug. Another equally distressing observation is that the code can become very complex very quickly due to formatting and conditional mappings which need to be configured in the mapper configuration.
The only one thing that I liked about AutoMapper is that I can tack away the mapping code making service operations, controller actions and methods in general more readable. Hence, in the spirit of putting away the mapping code I prefer to do explicit mapping using extension methods.
The following snippet of code maps AssetDto to AssetViewModel.
Mapping the ViewModel to a Dto would be done just in the same fashion through extension methods.
To Table of contents
Subscribe to:
Post Comments (Atom)
A1 Repo: Simple Pagination for WCF Service Operation
It is never a good idea to paginate on the client. This post is about a simple pagination for a WCF service operation. For this work I nee...
-
There are times when a collection of lookup to populate a drop down list is needed; this is very common. The usual solution is to create an...
-
Motivation We have became accustomed to using design patterns to solve common and complex problems that recur often in software engineering ...
-
Bad Data Is No Better Than No Data: Then, Validate Ebenezer! After my previous post, Noding, MongoDBing With Mongoose: On the Account of t...
No comments:
Post a Comment