Monthly Archives: July 2010

DTO <—> Entity Types conversion

Sometimes, we have to work with DTO very similar than our entities. I wrote this class to make the conversion. /// <summary>/// Extension methods to convert an EntityType to a DTO and reversely/// </summary>public static class DTOConversion{    /// <summary>    /// Gets an EntityType from a DTO    … Continue reading

Posted in 7671, 7674 | 5 Comments

Want to improve Contains execution time? Use a Dictionary instead of a List

Most of you probably know that instead of using multiple string concatenation, using the StringBuilder class is better. But did you know that the Contains method is more efficient with a Dictionary than with a list? With the following sample, … Continue reading

Posted in 7672 | 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? v2

I posted a first version on this topic few days ago. However, the Regex pattern wasn’t perfect because it didn’t support every case (join on table valued functions for example was not supported). Moreover, with ExecuteStoreQuery method, properties and columns … Continue reading

Posted in 12253, 7671, 7674 | 1 Comment