Skip to content

Instantly share code, notes, and snippets.

Created September 9, 2014 00:05
What would you like to do?
//configuration, se réalise habituellement au démarrage de votre application
Mapper.CreateMap<Model, ViewModel>();
//création d'un objet "Model" pouvant provenir d'une base de données
var model = new Model
PageTitle = "Titre de page"
//Mappage du Model en ViewModel
var viewModel = Mapper.Map<Model, ViewModel>(model);
//retourne "Model
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment