IEnumerable vs. IQueryable
It is extremely important that the programmer knows the difference between IEnumerable and IQueryable. When used in the Service layer, which communicates with the Data layer, the performance difference is extreme. IEnumerable causes a query to bring over all of the query’s table rows and then filter them (your WHERE clause) on the web server by iterating over every row and applying the “WHERE”. That’s work not intended for a web server and can mean the difference between a quick…