You can reproduce this easily in your MapDynamicTests if you change the Customer's Order type from ICollection<Order> to Order[] and then try to map a customer with more than one Order. The resulting array will always contain only the final Order.
Looking through the code I think this is caused by the MapCollection method, which for arrays does
var arrayList = new ArrayList { instanceToAddToCollectionInstance };
or in the case where isNewlyCreatedInstance is false
var arrayList = new ArrayList((ICollection)instance);
In both cases shouldn't that instead be
var arrayList = new ArrayList((ICollection)instance) { instanceToAddToCollectionInstance };
You can reproduce this easily in your
MapDynamicTestsif you change the Customer's Order type fromICollection<Order>toOrder[]and then try to map a customer with more than one Order. The resulting array will always contain only the final Order.Looking through the code I think this is caused by the
MapCollectionmethod, which for arrays doesor in the case where
isNewlyCreatedInstanceis falseIn both cases shouldn't that instead be