public CommercialData AddLineItems(params CommercialLineItem[] items) { LineItems.AddRange(items); return(this); }
/// <summary> /// Additional operations to be performed when cloning an instance of <see cref="Order"/> to an instance of <see cref="PSOrder" />. /// </summary> /// <param name="order">The order being cloned.</param> private void CloneAdditionalOperations(Order order) { LineItems.AddRange(order.LineItems.Select(o => new PSOrderLineItem(o))); OrderId = order.Id; }
public void AddLineItems(IEnumerable <InvoiceLine> invoiceLines) => LineItems.AddRange(invoiceLines ?? new List <InvoiceLine>());
/// <summary> /// AppendInvoices appends the items from the sourceInvoice to the current invoice /// </summary> /// <param name="sourceInvoices">Invoice to merge from</param> public void AppendInvoices(IEnumerable <Invoice> sourceInvoices) => LineItems.AddRange(sourceInvoices == null ? new List <InvoiceLine>() : sourceInvoices.SelectMany(i => i.LineItems));
/// <summary> /// MergeInvoices appends the items from the sourceInvoice to the current invoice /// </summary> /// <param name="invoiceToMerge">Invoice to merge from</param> public void MergeInvoices(Invoice invoiceToMerge) { var copyOfInvoiceToMerge = invoiceToMerge.Clone(); LineItems.AddRange(copyOfInvoiceToMerge.LineItems); }