I use EF6 with MvvmLight and Wpf (.NET 4.7.2) and SQL Server.
On my forms I have some comboboxes. They data bind to lists where list have about 200.000X4 data.
When I fill it, it take for me about 18 seconds (where SQL select takes about 7 seconds). I have 3 or more, so my window open nearby 2 minutes. I think its slow. I would like to solve this problem.
My combos need searching property so I not choose LinkedList. I thinking use a dynamically change List or what, about 100-1000 items of data.
How should I start or where could I searching?
An other half question is why generate ToList
from EF IQueryable<T>
is too slow, what should do instead of that? Combobox use VirtualizingStackPanel, so after I loading millions of items of data into the list, with this no problem.
But if anyway faster, I wouldn't like store all of the data in AlkLista (as combobox itemssource)
Thanks every helps.
Steve
ctx is my EF context, I binding AlkLista to combobox now
AlkLista = new List<AlkCikkNev>(ctx.Alkatrészek
.OrderBy(t => t.Alkatrész_AZ)
.Select(t => new AlkCikkNev
{
AlkAz = t.Alkatrész_AZ,
Cikkszam = t.Cikkszám,
Nev = t.Név,
Rajzszam = t.Rajzszám
}).OrderBy(t => t.Cikkszam)