My objects don't have a default constructor, they all require a signature of
new Entity(int recordid);
I added the following line:
Mapper.CreateMap<EntityDTO, Entity>().ConvertUsing(s => new Entity(s.RecordId));
This fixes the problem where Automapper is expecting a default constructor, however the only element that is mapped is the record id.
How do I get it to pick up on it's normal mapping? How to get all the properties of the entities to be mapped without having to manually map the properties?
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…