Tag Archives: Entity Framework

Checking for NULL using Entity Framework

Here is a curious gotcha using the Entity Framework: If you are filtering on a value that may be null then you may not be getting back the results you expect. For example, if you do something like this: var … Continue reading

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

Getting just the columns you want from Entity Framework

I’ve been looking at trying to optimise the data access in the project I’m working on, and the major stuff (like getting a piece of code that generated 6000 queries down to just 7) is now done. The next step … Continue reading

Posted in Software Development | Tagged , | Leave a comment

Entity Framework query that never brings back data

I was recently optimising some data access code using the Entity Framework (EF) and I saw in the SQL Server Profiler this following emanating from the application: SELECT CAST(NULL AS varchar(1)) AS [C1], CAST(NULL AS varchar(1)) AS [C2], CAST(NULL AS … Continue reading

Posted in Software Development | Tagged , | 1 Comment

Entity Framework: Unable to load the specified metadata resource.

Recently, I was refactoring some code and I moved the location of the .edmx file into a different folder (and new namespace). I updated the code to use the new namespace but when I ran the application a MetadataException was … Continue reading

Posted in Software Development | Tagged , , , , , | 1 Comment