Tag Archives: linq

Linq to entities and CAST

We use an EDMX to access our database with Entity Framework. Before you comment: we have our reasons not to use code-first. Today we encountered a small problem with linq to entities and validating a varchar field that contains an integer … Continue reading

Posted in Development | Tagged , , , , | Leave a comment

Ask google

In my case I ended up on a number of stackoverflow pages. Unit testing error, could not load file or assembly To reproduce a bug I created a unit test with Rhino mocks. The testclass inherited from the testObject which … Continue reading

Posted in Development | Tagged , , , | Leave a comment

LINQ to Entities does not recognize the method

After my unit tests showed all green, there was still a bug in my code. System.NotSupportedException: LINQ to Entities does not recognize the method ‘System.Collections.Generic.IList`1[iCal.ISchedulerEvent] ProcessItem(iCal.ISchedulerEvent)’ method, and this method cannot be translated into a store expression. Solution is to … Continue reading

Posted in Development | Tagged , , | Leave a comment

ExcludeFromCodeCoverage and Linq

Visual Studio has an attribute called ExcludeFromCodeCoverage to exclude a method from code coverage. But when you use Linq the predicate is included. See sample screenshot below where the code is called with an empty list in the repository. Looking … Continue reading

Posted in Development | Tagged , , | Leave a comment