database 2The Problem: You attempt to do a query using Linq To Entities and your code does not work.

The Cause: For reasons unknown, Linq to Entities has different operators than Linq To Sql.

The Solution: Call your initial query/pull and us .ToList() on it before you run any of the problem operators – this fixes the problem entirely.


I amĀ embarrassedĀ to say that I spent 30 minutes trying to get Linq to Entities to work directly before I thought of that.

Creative Commons License photo credit: Tim Morgan