Ejemplo n.º 1
0
 public static void Main()
 {
     var config    = new MapperConfiguration(cfg => cfg.AddProfile <OrderMappingProfile>());
     var mapper    = config.CreateMapper();
     var orderList = new OrderDtoList {
         Orders = Enumerable.Range(1, 10).Select(i => new OrderDto {
             Id = i
         }).ToArray()
     };
     var orders = mapper.Map <List <Order> >(orderList);
 }
Ejemplo n.º 2
0
 public List <Order> Convert(OrderDtoList source, List <Order> destination, ResolutionContext context)
 {
     return(context.Mapper.Map <List <Order> >(source.Orders));
 }
Ejemplo n.º 3
0
 public List <Order> Convert(OrderDtoList source, List <Order> destination, ResolutionContext context)
 {
     return(source.Orders.Select(f => context.Mapper.Map <Order>(f)).ToList());
 }