Exemplo n.º 1
0
        public IActionResult DeliveryDetail(long deliveryId)
        {
            var deliveryVm = DeliveryVm.MapToViewModel(_deliveryBlProvider.GetSingle(deliveryId));


            return(PartialView("_OrderDetail", deliveryVm));
        }
Exemplo n.º 2
0
        public static AttachmentVm MapToViewModel(Entities.Entities.Attachment source)
        {
            var config = new MapperConfiguration(cfg => cfg.CreateMap <Entities.Entities.Attachment, AttachmentVm>()
                                                 .ForMember(x => x.Delivery, y => y.MapFrom(z => DeliveryVm.MapToViewModel(z.Delivery)))
                                                 );

            var mapper      = config.CreateMapper();
            var destination = mapper.Map <AttachmentVm>(source);

            return(destination);
        }