The .NET Framework has many generic purpose collection classes, which actually do much more than what's required for most situations and maybe because of doing too much they aren't optimized for the most common uses. To me, the biggest example is the List class. In many situations if we simply want to load a variable number of data in memory before doing a foreach (this happens if we read a file or get data from the database and we want to close such resource before the foreach) we will use a list to put such data in memory. The List is actually the simplest class in the .NET Base Class Library that can be used to do this kind of job, so it seems to be the ideal one... but actually it is possible to do better and this article is all about it.


I guess you came to this post by searching similar kind of issues in any of the search engine and hope that this resolved your problem. If you find this tips useful, just drop a line below and share the link to others and who knows they might find it useful too.

Stay tuned to my blogtwitter or facebook to read more articles, tutorials, news, tips & tricks on various technology fields. Also Subscribe to our Newsletter with your Email ID to keep you updated on latest posts. We will send newsletter to your registered email address. We will not share your email address to anybody as we respect privacy.


This article is related to

C#,.NET,Architect,Intermediate,VS2012,.Net,Articles,Computer Tutorials