Tag Archives: Domain Model

Flattening object with AutoMapper

I blogged about basic concept of AutoMapper before. AutoMapper supports flattening complex object model into DTO or other simple object model. For example, domain model usually has complex object model with many associations between them, but view model has flat object model. We can map domain object model to view object model with AutoMapper’s flattening. If you follow the naming convention of your destination object model, then you don’t need to provide any configuration code to AutoMapper. AutoMapper work with convention based and map your object model from complex to flat/simple one.

Continue reading

Advertisements

AutoMapper

In programing we often need to map one object to another. For example, suppose you are working with MVC pattern and you need to map your domain model with view model. This kind of mapping code are time consuming to write and not easy to test. So why not use a tool which take the heavy lifting for us.

Continue reading