Click here to Skip to main content
11,632,778 members (82,692 online)

The Insider News

   

The Insider News is for breaking IT and Software development news. Post your news, your alerts and your inside scoops. This is an IT news-only forum - all off-topic, non-news posts will be removed. If you wish to ask a programming question please post it here.

Get The Daily Insider direct to your mailbox every day. Subscribe now!

 
NewsIs it better to call ToList() or ToArray() in LINQ queries? Pin
Clifford Nelson21-Nov-12 5:59
memberClifford Nelson21-Nov-12 5:59 
I have been working under the wrong assumption that ToArray would be better than ToList with LINQ queries. The truth is that ToList is slightly faster, but takes slightly more memory. Seems like it is better to use ToList (http://stackoverflow.com/questions/1105990/is-it-better-to-call-tolist-or-toarray-in-linq-queries[^])
GeneralRe: Is it better to call ToList() or ToArray() in LINQ queries? Pin
AspDotNetDev21-Nov-12 7:09
protectorAspDotNetDev21-Nov-12 7:09 
AnswerRe: Is it better to call ToList() or ToArray() in LINQ queries? Pin
Clifford Nelson21-Nov-12 12:13
memberClifford Nelson21-Nov-12 12:13 
GeneralRe: Is it better to call ToList() or ToArray() in LINQ queries? Pin
AspDotNetDev21-Nov-12 12:30
protectorAspDotNetDev21-Nov-12 12:30 
GeneralRe: Is it better to call ToList() or ToArray() in LINQ queries? Pin
Andrew Rissing21-Nov-12 7:57
memberAndrew Rissing21-Nov-12 7:57 
GeneralRe: Is it better to call ToList() or ToArray() in LINQ queries? Pin
Clifford Nelson21-Nov-12 11:59
memberClifford Nelson21-Nov-12 11:59 
GeneralRe: Is it better to call ToList() or ToArray() in LINQ queries? Pin
Marc Clifton21-Nov-12 10:28
protectorMarc Clifton21-Nov-12 10:28 
AnswerRe: Is it better to call ToList() or ToArray() in LINQ queries? Pin
Clifford Nelson21-Nov-12 12:09
memberClifford Nelson21-Nov-12 12:09 
GeneralRe: Is it better to call ToList() or ToArray() in LINQ queries? Pin
Mathlab21-Nov-12 10:52
memberMathlab21-Nov-12 10:52 
AnswerRe: Is it better to call ToList() or ToArray() in LINQ queries? Pin
Clifford Nelson21-Nov-12 12:11
memberClifford Nelson21-Nov-12 12:11 
GeneralRe: Is it better to call ToList() or ToArray() in LINQ queries? Pin
ibrahim_ragab21-May-13 11:51
memberibrahim_ragab21-May-13 11:51 
AnswerRe: Is it better to call ToList() or ToArray() in LINQ queries? Pin
Clifford Nelson23-May-13 5:24
memberClifford Nelson23-May-13 5:24 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.


Advertise | Privacy | Mobile
Web03 | 2.8.150728.1 | Last Updated 29 Jul 2015
Copyright © CodeProject, 1999-2015
All Rights Reserved. Terms of Service
Layout: fixed | fluid