Open ZigmundL opened 4 years ago
ToList
is provided by LINQ and returns List<T>
, not AList
.
To ensure the data type is AList, you would have to call methods provided by AList
.
For example, instead of ToList
, use new AList<DbEntry>(all.Where(...)...)
.
If all
is an AList
, you could also write it like this:
var list = all.Clone();
list.RemoveAll(c => c.citt != "Liverpool"); // instead of `Where`
list = list.RemoveSection(0,150000); // instead of `Take`
Console.WriteLine(string.Join(",",list));
But I would guess that the first approach is faster in this case.
Hello. I have a list of 8.9kk objects which are loaded from sql database. I need to split this list into parts with some checks, conditions, shuffling and removals. Here is the first part:
I need to take 2x 150k from all (8,9kk), then remove them from all-list. My methods RemoveP() and RemoveL() are "optimised" with exact city and citys row position(ids) in db - very specific. (for loops with predefined hardcoded limits, that set object=null then RemoveAll(x=>x==null); ). They are not very interesting, I could have archived this methods are done in ~10 mins each.
Then I've met your lib which looks promising.
I'm trying to follow your "simply to add "A" in front". And it's not working, saying that ToList() is not returning AList. Casting is not working too (AList)list.ToList(); How is this working?