Use dynamic type in Entity Framework 4.1 SqlQuery() method

As the release of Entity Framework 4.1, the DbContext.Database.SqlQuery() method offers a way to execute a SQL command then maps the returning result set to a strong typed object or a list of strong typed objects. However, if you want to use the dynamic type or anonymous type as its return type, you will probably…

0

Why no ForEach method on IEnumerable interfaces

I was asked many times recently regarding this topic, why not Microsoft introduce an extension method ForEach() on interface IEnumerable<T>? The answer is: "No, and never". Here are some strong reasons to not bring this extension method on IEnumerable. I will be discussing the following design considerations in this post. Design pattern Consistency Runtime behavior…

6

Welcome to my new place

I have decided to move my Tech Blog from http://www.markzhou.com/blog to http://blogs.msdn.com/b/mazhou. The new blog service is hosted by Microsoft, it provides more features to have a better blog reading and integration experience. The legacy blog URL will continue to work, but it will automatically redirect to the new blog address. MSDN blog hosting has…

0