C# query only when textbox is edited
<p>I have a query that work on a great data table. The code for the query is:</p>

<pre><code>var getExtInv = snd.external_invoices.OrderByDescending(x =&gt; x.date).ToList();
var query = (from c in getExtInv
             join o in snd.invoices on c.idexternal_invoices equals o.id_external_invoice
             select new {c.idexternal_invoices,
                         c.businessname,
                         o.number,
                         c.message,
                         c.price,
                         c.date,
                         c.tipologiaPagamento,
                         c.esitoPagamento,
                         c.iduser
                        }).ToList();
</code></pre>

<p>I need to filter this query with a number of textbox value that can be empty. An example for one search filter is:</p>

<pre><code> if (txtIdUser.Text != "")
 {
    int idUserSel = Convert.ToInt32(txtIdUser.Text);
    query = query.Where(x =&gt; x.iduser == idUserSel).ToList();
 }
</code></pre>

<p>the problem is that with this approach initially load a very high number of data which then filter based on the presence or absence of textfield filled. In doing so the initial loading time is very long. How can I speed up the process?</p>

<p>Thanks to all</p>