public static SaleLine ToEntity(SaleLineDto dto) { return(new SaleLine { Cuantity = dto.Cuantity, SubTotal = dto.SubTotal, IdProducto = dto.Product.Id }); }
public static SaleDto FromEntity(Sale sale) { return(new SaleDto { Id = sale.Id, Date = sale.Date, Customer = CustomerDto.FromEntity(sale.Customer), Employee = EmployeeDto.FromEntity(sale.Employee), saleLineDtos = sale.SaleLines.Select(sl => SaleLineDto.FromEntity(sl)).ToArray() }); }