The EDM Designer only collects the information it needs for Entity Framework's native code generator. DevForce needs more information in order to generate its own entity classes. The DevForce EDM Designer extension adds features to the base EDM Designer that help the developer provide that extra information.
From the Visual Studio menu pick Tools | Extension Manager ... and scroll through the Extension Manager dialog until you see:
The DevForce 2012 EDM Designer extension is installed with DevForce.
If you don't see this extension, there are several possible reasons:
The extension changes the EDM Designer in two ways:
Once the extension is installed and enabled, when you open an EDMX file you'll see a message like the following in the "DevForce" pane of the output window:
Note that the extension will not load or process a model in a .NET 4.0 project. You must re-target the project to .NET 4.5 in order to use the DevForce 2012 EDM Designer Extension.
This screenshot shows the EDM Designer displaying information about an entity property.
The CompanyName property of the Customer entity has been selected in the diagram on the left. The Properties window on the right displays the EDM object definition properties of that CompanyName property, sorted by category.
In the middle of the Properties window is a new category, outlined in yellow, labeled “DevForce Code Generation”. This category was added by the DevForce EDM Extension. The properties in this category govern code generation of the CompanyName property.
The “Display Name” property is outlined in red with a value of “Company Name”. The developer is telling DevForce to add a .NET DisplayAttribute to the Customer’s CompanyName property when it generates the entity class code.
The DevForce EDM Extension writes this advice as an annotation to the CSDL section in the EDMX file. The CSDL definition of the CompanyName property looks like this:
XML | <Property Name="CompanyName" Type="String" Nullable="false" MaxLength="40" Unicode="true" FixedLength="false" ib10:DisplayName="Company Name" /> |
The attribute ib10:DisplayName is the DevForce annotation. After code generation the property looks like something like this:
C# | [Display(Name="Company Name", AutoGenerateField=true)] public string CompanyName {...} |
VB | <Display(Name:="Company Name", AutoGenerateField:=True)> Public ReadOnly Property CompanyName() As String ... End Property |
DevForce Code Generation sections adorn every level of the CSDL specification. At the top level are properties to control code generation for the model as a whole:
There are two ways to enable or disable DevForce code generation for the entity models.
On a per-EDMX basis
You can switch between the DevForce code generator and the Entity Framework default generator for a specific entity model by setting the "DevForce Enabled" field on the EDMX property sheet:
Globally for all of Visual Studio
You can enable or disable the DevForce extension itself from within the Visual Studio Extension Manager. Disabling the extension both removes the DevForce properties from the designer and disables DevForce code generation.