I'm mapping my Linq-To-SQL generated entities to DTOs using AutoMapper.
When I initially created the unit tests, I had specific maps (through a static configuration class) set up to convert one type of EntitySet to a generic List (and vice-versa)
Mapper.CreateMap<EntitySet<Member>, List<MemberDTO>>();
Mapper.CreateMap<List<MemberDTO>, EntitySet<Member>>();
Upon removing the list conversions (upon figuring out that AutoMapper will convert these automatically), my unit tests still worked, but they slowed to a crawl. It was so noticeably slow, it took literally a minute to perform each test.
After re-adding the list mappings, the Unit Tests resumed their normal performance speeds.
Is there a way to turn this auto conversion for lists off, so that I HAVE to map my list conversions? I'd like it to throw an AutoMapperException if I fail to include a Map. I'd like to avoid these performance issues.
If worse comes to worse, I might just end up writing a quick code generation template to automagically create my mapping configuration class based off of the DTOs. That way, I won't miss anything.
Thanks.