Entity Data Model Designer Prototype

Screen Captures from Initial Tests of the EDM Designer Prototype CTP

The EDM Designer Prototype CTP is limited to editing the conceptual layer schema file (CSDL). Future versions are expected to be capable of editing the mapping (MDL) and source schema (SSDL) files.

Navigation:

Link to "New Entity Data Model Designer Prototype" item on the OakLeaf blog

Link to more details on the ADO.NET vNext August 2006 CTP on the OakLeaf blog

Link to the full OakLeaf blog

Link to the OakLeaf Web Site Home Page

Figure 1 - Setting a Database Connection with the Entity Data Model Wizard 

Selecting Generate from Database in the Wizard's Model Contents dialog opens this Database Connection dialog. The Wizard is the same as that of the ADO.NET vNext August 2006 Community Technical Preview.

If you name the connection string NorthwindModel.Northwind your code uses it automatically.

Figure 2 - Selecting All Tables from the Northwind SQL Server 2005 Database

Figure 3 - Initial Model After Rearranging Entity Diagram (Click to Display at 800 x 600)

The Order Details entity doesn't have relationships with Orders and Products because the EDM August 2006 CTP doesn't support composite primary keys.

Figure 4 - JPEG Export of Initial Model (Click to Display Full Size - 800x600)

Notice the incorrect 1:many relationship of Employees to Employees (for the ReportsTo foreign key)

Figure 5 - Model After Renaming Entities (Singularizing All and SalesOrder/LineItem)

Renaming EntityTypes as the singular version of the plural EntitySet name requires quite a bit of manual editing or the EDM file. Changing the name of the Employees EntityType to Employee causes the Employee63 member of the FK_Employees_Employees Association to lose its 63 suffix.

Figure 6 - JPEG Export After Renaming Entities

You must specify a 1:1 relationship for the ReportsTo foreign key and the Employees entity set .

Figure 7 - Initial Version of a Windows Test Harness for the EDM Designer Prototype

Click to display the full-size screen capture. The execution times in the row of text boxes are for opening each Entity Set the second time (cached) and displaying its standard set of property values in the DataGridView.

Columns appear in an apparently random order, but column ordinals are consistent for each EntitySet (i.e., column sequence doesn't change when you close and reopen the Windows form.)

Figure 8 - Initial Execution Times to Open and Retrieve Related EntityCollections

The times in the row of text boxes are for initial population of the DataGridView with added columns populated with foreign key values, counts of related EntityCollections, or both. As an example, the Customers EntitySet has an added SalesOrders column with the count of the members of the SalesOrders EntityCollection for each Customer returned by the FK_SalesOrders_Employees.GetSalesOrderEntities(Empl) method. The Employees EntitySet has an added SalesOrders column and a ReportsTo column populated by the FK_Employees_Employees.GetEmployee(Empl) method. Retrieval of related objects is explicitly deferred, so you must execute the FK_Employees_Employees.GetEmployeeRef(Empl).Load() or similar method if the related Entity or EntitySet isn't already loaded.

Notice the extraordinary length of time (80 seconds) required to process the 830 sales orders. There might be a more efficient method for simply returning foreign key values, which don't appear as properties of the EntityTypes.

Figure 9 - Cached Execution Times to Open and Retrieve Related EntityCollections

Once the Entities and EntitySets are cached, execution times are reduced greatly, as shown here.

Figure 10 - Employee.ReportsTo:Employee.EmployeeID Association Test - Uncached

The following correct ReportsTo values appear for the initial retreivals:

Figure 11 - Employee.ReportsTo:Employee.EmployeeID Association Test - Cached

 However, the first six Employee.ReportsTo values are missing from the cached version of the second and later retreivals.

There is no obvious explanation for the loss of the six ReportsTo values when using the cache. Notice that the reports to values in Figure 10 are 2 (5 instances), 5 (3 instances), and null (1 instance).