Mapping Lists using Automapper
Mapper.CreateMap<Person, PersonViewModel>(); peopleVM = Mapper.Map<List<Person>, List<PersonViewModel>>(people); Mapper.AssertConfigurationIsValid(); From Getting Started: How do I use AutoMapper? First, you need both a source and destination type to work with. The destination type’s design can be influenced by the layer in which it lives, but AutoMapper works best as long as the names of the members match up … Read more