I'm using Automapper and I have the following scenario:
Class OrderModel has a property called 'ProductName' that isn't in the database.
So when I try to do the mapping with:
Mapper.CreateMap<OrderModel, Orders>();
It generates an exception :
"The following 1 properties on Project.ViewModels.OrderModel are not mapped: 'ProductName'
I've read at AutoMapper's Wiki for Projections the opposite case (the extra attribute is on the destination, not in the source which is actually my case )
How can I avoid automapper to make the mapping of this property?
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…