using AutoMapper;
using OdataApplication.Models;
using WebApplication4.ViewModels;

namespace WebApplication4
{
    public class MappingProfile : Profile
    {
        public MappingProfile() 
        {
            CreateMap<Order, OrderVm>();
            CreateMap<Shipper, ShipperVm>()
                .ForMember(s => s.OrderIds, o => o.MapFrom(d => d.Orders.Select(s => s.OrderId)));
        }
    }
}
