public ProductDto(Product product) : base(product) { if (product != null) { Number = product.Number; SellingPrice = product.SellingPrice; Supplier = new SupplierDto(product.Supplier); } }
public OrderDto(Order order) { if (order != null) { Id = order.Id; Date = order.Date; OrderState = order.State; Supplier = new SupplierDto(order.Supplier); Products = new List <ProductSupplierDto>(); foreach (ProductSupplier product in order.Products) { Products.Add(new ProductSupplierDto(product)); } } }