I am having a strange issue with AutoMapper.
If I do the following
//Get my entities from EF repository
var movements = _movementRepository.AllIncluding(movement => movement.Asset, movement => movement.Job,movement => movement.Asset.MinorEquipmentType);
var model = new List<AssetMovementDetail>();
foreach (var assetMovementDetail in movements)
{
model.Add(Mapper.Map<AssetMovementDetail>(assetMovementDetail));
}
This works perfectly and gives me the results if I expect.
If alternatively I change model to be generated like:
var model = Mapper.Map<List<AssetMovementDetail>>(movements);
The results are different and have the same total number of results but many of the results are duplicates of each other and others are missing. Am I doing something wrong? Is this not how it is supposed to work.
, List>(movements);
– GraemeMiller Sep 27 '12 at 13:45