I cannot get the following to work, where array is an array of CustomerContract's:
Mapper.Map<IEnumerable<Customer>>(array);
Mapper.Map<IEnumerable<CustomerContract>, IEnumerable<Customer>>(array);
Mapper.Map<Array, List<Customer>>(array);
In my mind the first example should be enough, but i can not get either to work. I have read the configuration wiki of automapper (https://github.com/AutoMapper/AutoMapper/wiki/Configuration), but i do not understand why this should be necessary. Everything Automapper needs is defined in the command. Which type it is (both object and that it is a list), and which object i want it to map to.
Am i just not understanding the core concept of Automapper?
My exception sounds like this:
Missing type map configuration or unsupported mapping.
Mapping types:\r\nCustomerContract -> Customer\r\nStimline.Xplorer.Repository.CustomerService.CustomerContract -> Stimline.Xplorer.BusinessObjects.Customer
Destination path: List`1[0]
Source value: Stimline.Xplorer.Repository.CustomerService.CustomerContract
>(array)... why does it not?
– Bjørn Jun 11 '14 at 06:51