The 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.
photo credit: Tim Morgan
This post originally appeared on the Stronico blog – with the absorption of Stronico into Digital Tool Factory this post has been moved to the Digital Tool Factory blog
Tags: Microsoft
|
Written By Steve French |
Leave a Reply