public IActionResult DeliveryDetail(long deliveryId) { var deliveryVm = DeliveryVm.MapToViewModel(_deliveryBlProvider.GetSingle(deliveryId)); return(PartialView("_OrderDetail", deliveryVm)); }
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); }