Category Archives: 9104

L2E: SQL impact

As I wrote yesterday, “Behind the EF magic, there is the SQL reality. I’m sticking to my guns, if you don’t know SQL, you can’t write best Entity Framework queries. I find a good sample with grouping functions.” Yesterday, I … Continue reading

Posted in 12253, 7671, 7674, 9104 | 2 Comments

How to get many grouping functions in only one query with LINQ?

Behind the EF magic, there is the SQL reality. I’m sticking to my guns, if you don’t know SQL, you can’t write best Entity Framework queries. I find a good sample with grouping functions. Imagine that you want to get … Continue reading

Posted in 12253, 7671, 7674, 9104 | Leave a comment

Why using Entity Framework?

In this post, we will use a sample and we will study its implementation with DataReader / LINQ To SQL / Entity Framework. In this sample, we will use the following database : The method I want to code has … Continue reading

Posted in 7671, 7674, 7676, 9104 | 1 Comment

EF4 vs SQL Challenge

Hi SQL Heroes I think that Entity Framework is awesome for many reason and one of them is to simplify a lot queries with very good performance. I think that EF4 generated SQL is better than SQL written by the … Continue reading

Posted in 12253, 7671, 7674, 9104 | Leave a comment

Entity Framework: Be vigilant with Include method!

Include method is very easy to use and it’s great. But its implementation is not always the best one. Why? The Include method allows you to get entity graph with only one SQL query. The idea is excellent but… The … Continue reading

Posted in 7671, 7674, 9104 | Leave a comment

Entity Framework 4 and MutiResultSet, execute multiple queries on only one DB access

In the EFExtensions project, we have an illustration of the use of MutiResultset with EF which is a good idea. However, this is used only with Stored Procedure. Moreover, contrary to what is done on it, I don’t want to … Continue reading

Posted in 7671, 7674, 9104 | Leave a comment

How to include recursion / table valued functions in LINQ To Entities queries with EF4?

In this post, we use Northwind DB with this EDM:   I want to get all orders for an employee or his sub-employees in only one T-SQL query. Recursion with T-SQL => CTE. The problem is the fact that EF4 … Continue reading

Posted in 12253, 7671, 7674, 7675, 9104 | 2 Comments

Bulk Delete v3

In my last two posts (Bulk Delete with EF4 and Bulk Delete only for loaded entities), I showed you how to do Bulk delete with EF4. However, there are some issues that I will try to fix with this new … Continue reading

Posted in 7671, 7674, 7675, 9104 | 4 Comments

4 in 1: EF won’t fire DBAs, Velocity, SQL CLR and SQL Dependency

Imagine that we have a table Cars with a PK Id (nvarchar(8)) based on the following regex pattern [1-9][0-9]{1,2}[A-Z]{2,3}[0-9]{2}. The last two numbers are a region code. The increasement is done like this: 10AA[region], 11AA[region], …, 999AA[region], 10AB[region], …, 999ZZ[region], … Continue reading

Posted in 10500, 12229, 7671, 7674, 7675, 9104 | Leave a comment

EDM can save your hair :-)

I am doing a training this week and one of my student told me that his DB can be used with EF. Indeed, his base isn’t great for EF: a table Bases with 4 columns: Id, int, Identity (PK) Key, int, … Continue reading

Posted in 7671, 7674, 7675, 9104 | 2 Comments