Hi, im trying to get all data for invoices and their invoicelines for a given period.
My problem is that as far as i can see, i have to get the matching IInvoice for an IInvoiceData using the property 'Number', if i want to get the InvoiceLines. This gives me at least one request per invoice found in 'session.Invoice.FindByDate'.
Is it possible to get IInvoiceLines from an IInvoiceLineData?
or Is it possible to match an IInvoiceData on an IInvoice using something other than the Number property, e.g. some sort of Id, that isnt lazyloaded?
Below is the code in question.
// TODO Performance problem Calls economic api with one request per invoice, when getting 'Number'
// See TODO below
var invoices = sessionInvoiceFindByDate(@from, to)ToDictionary(x = xNumber, x = x);
var invoiceDatasForDebtor = sessionInvoiceData
Where(x = xDebtorEquals(debtor))ToList();
var lineDatasByInvoiceNumber = new Dictionaryint, IInvoiceLineData();
foreach (var invoiceData in invoiceDatasForDebtor)
//TODO Is it possible to get IInvoiceLineData's from IInvoiceData instead of IInvoice?
var invoice = invoicesinvoiceDataNumber;
lineDatasByInvoiceNumberinvoiceDataNumber = sessionInvoiceLineDataGetDataArray(invoiceGetLines());