EF query execution pattern. Usage of sp_executesql vs direct execution of sql statement

This was posted in an internal discussion. The question was that it was observed that sometimes in the generated sql it appeared that EF was very decisive between directly executing the query and sometimes using sp_executesql. Before I go ahead and explain this behavior a little background on sp_executesql. The sp_executesql comes into play when…

0

ObjectSet<T> vs ObjectQuery<T> in Entity Framework v 4

I was a little curious about this change in EFv4 and wanted to understand why this was done. So here is what I was able to understand Background Lets take a look at the following code for querying the EntitySet in EF v3.5 using (NorthwindEntities ex = new NorthwindEntities()) { var cus = ex.Customers; foreach…

0