I'm trying to map an array into an ICollection of type <T>.
ICollection
<T>.
Basically I want to be able to do:
Mapper.CreateMap<X[], Y>();
Where Y is Collection<T>
Y
Collection<T>
Any ideas?
You don't need to setup your mapping for collections, just the element types. So just:
Mapper.CreateMap<X, Y>(); Mapper.Map<X[], Collection<Y>>(objectToMap);
See here for more info: http://automapper.codeplex.com/wikipage?title=Lists%20and%20Arrays&referringTitle=Home
1.4m articles
1.4m replys
5 comments
57.0k users