public void addRequests(List <InvoiceModel> newRequests) { foreach (InvoiceModel request in newRequests) { if (request.Type == RequestType.PDF) { Request.Insert("PDF", request.pathPdfSource); } else { Request.Insert("XML", request.sourceXmlText); } } CompleteProcess(); }