I have a presentation model that I received from a client that looks something like this.
public class OrderViewModel { public string Name{get;set;} public string ContactDetails {get;set;} public List<FunkyThing_ViewModel> {get;set;} } public class FunkyThing_ViewModel { public string ThingName{get;set;} public string Colour{get;set;} public string Size{get;set;} }
I want to match this with a list of domain models, where each looks something like this:
public class Order { public string Name{get;set;} public string ContactDetails {get;set;} public string ThingName{get;set;} public string Colour{get;set;} public string Size{get;set;} }
So, I want everything to end up looking like this:
List<Order> orders = new Orders(); Mapper.CreateMap<OrderViewModel, List<Order>>();
source share