Tuesday, October 8, 2013

IEnumerable vs IList

In regards to our recent experience with the .ToList() function, it has come to our attention that we should have been using IEnumerable when gathering data from our Entities instead of returning a type of List in which we have to cast it using ToList() method. Why you ask? It is because using an object with type of IEnumerable gives us time to set aside the system’s data gathering until such that it is needed.

-What Are You Saying c0dem0nkey?

Think of this as something like Lazy Loading , where you put off data retrieval so that you can optimize the performance of your software where possible. Just remember to cast you IEnumerables to Lists so that you can manipulate your data more efficiently when needed.

Happy Coding >:]

-c0dem0nkey