public static Invoice ToEntity(this InvoiceDTO dto)
        {
            var entity = new Invoice
                             {
                                 InvoiceNumber = dto.InvoiceNumber,
                                 InvoiceDate = dto.InvoiceDate
                             };

            return entity;
        }
 /// <summary>
 /// Deprecated Method for adding a new object to the Invoices EntitySet. Consider using the .Add method of the associated ObjectSet&lt;T&gt; property instead.
 /// </summary>
 public void AddToInvoices(Invoice invoice)
 {
     base.AddObject("Invoices", invoice);
 }
 /// <summary>
 /// Create a new Invoice object.
 /// </summary>
 /// <param name="invoiceNumber">Initial value of the InvoiceNumber property.</param>
 /// <param name="invoiceDate">Initial value of the InvoiceDate property.</param>
 /// <param name="id">Initial value of the Id property.</param>
 public static Invoice CreateInvoice(global::System.String invoiceNumber, global::System.DateTime invoiceDate, global::System.Int32 id)
 {
     Invoice invoice = new Invoice();
     invoice.InvoiceNumber = invoiceNumber;
     invoice.InvoiceDate = invoiceDate;
     invoice.Id = id;
     return invoice;
 }