Nicolas Metaye

.NET SENIOR DEVELOPER

The main technologies I'm working with are .NET, Azure, JavaScript and SQL Server. I'm always happy to learn new patterns, concepts, technologies and languages (and not only the programming ones!). You will find on this web site my resume and some of my personal projects / mockups /experiments.

Tilburg, Netherlands

nicolas.metaye@gmail.com

AutoMapper

SOURCE CODE

This project is an iteration from the MVC project but with AutoMapper integrated to it.
AutoMapper is a very useful library that allows to do powerful mapping in a clean and easy way.

AutoMapper

Using AutoMapper with MVC is very natural as you almost always want to map your data objects to your models.

The concept of AutoMapper is to define some profiles that contain all your maps. At the launch of your application you register all the profiles and you can use the mapping functions from the Mapper class provided by the library.
In the project, all the maps are registered dynamically in the AutoMapperConfiguration class to avoid having to change it for each time I add a map in the future.

Another advantage of AutoMapper is to move a part of the business logic that was in the controllers to the profiles classes.
It makes the controllers cleaner and makes the maps very easy to unit test as well (have a look the MappingTests class to see them).

Get in touch !