/* #endregion */ /* #region OrderDetail */ public static OrderDetailDTO ToDTO(this OrderDetail orderDetail) { return(new OrderDetailDTO { Id = orderDetail.Id, OrderId = orderDetail.Id, Image = new Func <ImageUrlDTO>(() => { var dto = new ImageUrlDTO(); foreach (ImageUrl url in orderDetail.Product.ImageUrls) { return dto = url.ToDto(); } return dto; })(), ProductName = orderDetail.Product.Name, ProductId = orderDetail.ProductId, Quantity = orderDetail.Quantity, ProductType = orderDetail.Product.Type, ProductPrice = orderDetail.Product.Price }); }
public static ImageUrl ToImage(this ImageUrlDTO dto) { return(new ImageUrl { Url = dto.Url }); }