Summary 09.08.2009 – 11.08.2009



Simone Chiaretta dissects the DropDownList helper method.

David Hayden continues his post from yesterday showing how we can separate the validation annotations into a metadata class via BuddyMetadataProvider similar to how DynamicData works.


Daniel Cazzulino shows how to achieve strongly typed reflection for generic types and methods by creating a delegate of the target method and using the delegate’s properties to get the corresponding MethodInfo.

The CLR team talks about IL Stubs Everywhere feature in C# 4.0 that allows the same IL stubs infrastructure for all marshalling on all platforms.

Bart DeSmet presents the new System.Linq.Expressions namespace in C# 4.0.

Design patterns

Jeremy Miller announces that the presentation patterns wiki is live!


Jonathan Oliver has an excellent post about distributing a single bounded context on different machines and dealing with optimistic concurrency.

Entity Framework

Julie talks about entity properties that we can take advantage of in EF 4.0 and that are designed for model first and dynamic data support.


Fredrik Normen shows how SubmitChanges mechanism works in .NET RIA Services.


Mike Taulty has a nice post about Unity’s features.

Shout it

kick it on


Summary 07.08.2009 – 08.08.2009



David Hayden shows how the support for System.ComponentModel.DataAnnotations in DefaultModelBinder works in ASP.NET MVC 2.0 Preview 1.

Entity Framework

Julie Lerman talks about code only support and query improvements in EF 4.0.

Alex James talks about structural annotations.


Bart DeSmet has an excellent introductory post about MEF.

Shout it

kick it on

Summary 06.08.2009


Entity Framework

In the latest MSDN Magazine, David Simmons talks about N-Tier Application Patterns and Tim Mallalieu talks about Data Access Architecture Best Practices.

Simon Seagal has an interesting post about fetching strategies in EF 4.0. Also Alex James has a nice post about implementing fetching strategies.

Mattieu Mezil show how to use TypeDescriptors to make FK work in EF 1.0.

In his 30th tip, Alex James shows how to use database functions in EF 1.0 and EF 4.0.

The ADO.NET team presents the improvements to the generated SQL for Entity Framework.


Phil Haacked shows how to focus in View pages on presentation concerns by moving Page declaration to web.config. He also shows a prototype of default templated views that we might have in the future bits of MVC.


Kirill Osenkov points out the C# compiler team blogs.

Chris Burrows has a nice post about dynamic base classes.

Eric Lippert has another bunch of excellent articles:

Learning resources for ASP.NET 4.0 WebForms new features


After sharing the C# 4.0, EF 4.0 learning resources, I thought posting the resources for ASP.NET 4.0 WebForms.



Client ID


Data Controls


Dynamic Images

Control Adapters




kick it on

Shout it

Summary 05.08.2009



Jan Van Ryswyck talks about fluent domain methods for setting up complex aggregate roots and for implementing behavior on domain entities.

Alex James also shows how to work with fluent interfaces and how to use fluent interfaces with extension methods.

Jérémie Chassaing shows how Service Bus pattern can help in DDD with code reusability.

Ayende talks about decomposing an application into features as a way for separating different application functionality and to allow independent development.

Entity Framework

Julie Lerman shows how in EF 4.0 the function mapping feature is improved as the conceptual space also gets the function allowing it to be called from the entity directly and not through EntityClient. She also points out a bug when using T4 template instead of EntityModelCodeGenerator for CustomTool mode. Another great article is about the major improvements in EF 4.0 for working with complex types.

The Entity Framework Design team talks about the Code Only enhancements that will be available in the next release.

Alex James how to use T4 templates for generating entities that have regular expressions applied to them. He also continues his tips series :

Tip 27 – How to Implement BeforeSave Validation

Tip 28 – How to implement an Eager Loading strategy

Tip 29 – How to avoid LazyLoad or Load() reader issues

Design Patterns

Don Smith has an excellent about the usage of Model View ViewModel (MVVM) pattern and how to cleanly separate the View from the ViewModel in different scenarios including data bindings, animations, commands and parameters.


Sean Chambers has a great series about code refactoring.


Oleg Sych talks about the customization of the TFS Process Guidance with T4.

Shout it

kick it on

Learning resources for Entity Framework 4.0 new features


The learning resources for C# 4.0 proved to very useful for many people so I thought about doing the same thing for EF 4.0.

New features

SQL improvements

POCO Objects

Deferred Loading and Explicit Loading

Functions in LINQ to Entities

Tip 30 – How to use a custom database function

Model Defined Functions

EDM Designer

Model-First Support

Code Only Support

Complex Type Support

Table splitting


Design patterns



Self tracking entities

POCO T4 templates


EDM designer

Foreign keys



Tip 32 – How to create a database from SSDL – EF 4 only

Tip 31 – How to compose L2O and L2E queries

Tip 30 – How to use a custom database function

Tip 29 – How to avoid LazyLoad or Load() reader issues

Tip 28 – How to implement an Eager Loading strategy

Tip 27 – How to Implement BeforeSave Validation

Tip 26 – How to avoid database queries using Stub Entities

Tip 25 – How to get Entities by key the easy way

Tip 24 – How to get the ObjectContext from an Entity

Tip 23 – How to fake Enums in EF 4

Tip 22 – How to make Include really Include

Tip 21 – How to use the Single() operator – EF 4.0 only

Tip 20 – How to deal with Fixed Length Keys

Tip 19 – How to use Optimistic Concurrency with the Entity Framework

Tip 18 – How to decide on a lifetime for your ObjectContext

Tip 17 – How to do one step updates with AttachAsModified(..)

Tip 16 – How to mimic .NET 4.0’s ObjectSet<T> today

Tip 15 – How to avoid loading unnecessary Properties

Tip 14 – How to cache Entity Framework Reference Data

Tip 13 – How to Attach an Entity the easy way

Tip 12 – How to choose an Inheritance Strategy

Tip 11 – How to avoid Relationship Span

Tip 10 – How to understand Entity Framework jargon

Tip 9 – How to delete an object without retrieving it

Tip 8 – How to write ‘WHERE IN’ style queries using LINQ to Entities

Tip 7 – How to fake Foreign Key Properties in .NET 3.5 SP1

Tip 6 – How and when to use eager loading

Tip 5 – How to restrict the types returned from an EF Query

Tip 4 – Conceptual Schema Definition Language Rules

Tip 3 – How to get started with T4

Tip 2 – Entity Framework Books

Tip 1 – How to sort Relationships in the Entity Framework



kick it on

Shout it

MSBuild error “C:\WINDOWS\Microsoft.NET\Framework\v3.5\Microsoft.Common.targets(1993,9): error MSB3091: Task failed because “sgen.exe” was not found, or the correct Microsoft Windows SDK is not installed. The task is looking for “sgen.exe” in the “bin” subdirectory beneath the location specified in the InstallationFolder value of the registry key HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Microsoft SDKs\Windows\v6.0A. You may be able to solve the problem by doing one of the following: 1) Install the Microsoft Windows SDK for Windows Server 2008 and .NET Framework 3.5. 2) Install Visual Studio 2008. 3) Manually set the above registry key to the correct location. 4) Pass the correct location into the “ToolPath” parameter of the task.”


I fought for a couple of minutes with this error and I thought to share with you my solution.

The error was on my build machine which wasn’t having Windows SDK and I wasn’t planning to install it either.

I was having HKLM\SOFTWARE\Microsoft\Microsoft SDKs\.NETFramework\v2.0 key and the InstallationFolder key with the value C:\Program Files\Microsoft Visual Studio 8\SDK\v2.0\ so I thought about adding the key that was normally generated by Windows SDK.

So, I added HKLM\SOFTWARE\Microsoft\Microsoft SDKs\Windows\v6.0A key with the InstallationFolder key pointing to the same value as above and copied the missing sgen.exe into the bin\ folder under the above mention location.

I queued a new build a everything worked like a charm.

I hope this helps,