Skip to content

Instantly share code, notes, and snippets.

Embed
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
Console.WriteLine(viewModel.PageTitle);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.