"2017-06-13T05:38:23.260002"^^ . . . "2017-06-13T05:38:23.260002"^^ . . . . . . . . . . "2017-06-13T05:38:23Z" . . . . . . . . "2017-06-13T05:38:23Z" . . "%VOSWARNING%\n\n\n%META:TOPICPARENT{name=\"VirtIngresEntityFrameworkUsage\"}%\n\n---+++Manually creating EDM Associations (FKs) for the Ingres Tutorial database\n\nThe following steps will detail what is required to manually create *Associations* in your Entity Data Model.\n\nBefore commencing the process, you will need to determine where these associations exist and their multiplicity (e.g., one-to-one, one-to-many, etc.). NOTE: These steps will need to be repeated for each association.\n\n 1 The first Association I will deal with is the relationship between cust_orders and cust_info, identified by the presence of the Scalar Property cust_no in both entities. This is a one-to-one relationship, as an entry in a customer order may only be associated with one customer's information.\n%BR%%BR%%BR%%BR% \n 1 To add the Association, right-click on the Customer entity. Then, click *Add* -> *Association*.\n%BR%%BR%%BR%%BR% \n 1 You will now see the *Add Association* dialog.\n%BR%%BR%%BR%%BR% \n 1 Hit *OK*. The diagram will be refreshed to include the newly created association.%BR%%BR% \n 1 You now need to edit the mappings associated with the newly created association, so right-click the association on the diagram and select *Table Mapping* to display the *Mapping Details* pane.\n%BR%%BR%%BR%%BR% \n 1 Click the line that reads <Add a Table or View> to reveal a drop down list of all entities.\n%BR%%BR%%BR%%BR% \n 1 Here you need to select the entity on the right/far side of the association (the entity where the foreign key exists). In this example, it is the cust_orders entity.\n%BR%%BR%%BR%%BR% \n 1 The *Mapping Details* pane now refreshes to display both ends of the association. You will now be required to provide relevant target store data types in the *Column* column for the key fields, as depicted here.\n%BR%%BR%%BR%%BR% \n 1 Once the mapping is complete, you can build the project using *Build* -> *Build Solution*. NOTE: It is worthwhile to (re)build as each association is made, since the error messages can be a little confusing.\n%BR%%BR%%BR%%BR%\n 1 This should result in the following error, which is included here, since I (the author) found it misleading.\n%BR%%BR%%BR%%BR%\nThis error indicates that there are two sources — in this case, the cust_orders entity's Scalar Property cust_no and the Navigation Property cust_info in — which are being mapped to the same target column — the Ingres column cust_orders.cust_no — which is not supported.\n%BR%%BR%%BR%%BR%\n 1 The solution is simple! Delete the mapping for Scalar Property cust_orders.cust_no. Its only purpose is to hold data representing a relationship/association (it is a Foreign Key), which has already been represented by the newly-created association and resulting Navigation Property cust_no.%BR%%BR%\nRight-click on cust_orders.cust_no. Then, click *Delete*.\n%BR%%BR%%BR%%BR%\n 1 The model diagram will refresh to reflect this change.\n%BR%%BR%%BR%%BR%\n 1 Build the project, again, using *Build* -> *Build Solution*.\n%BR%%BR%%BR%%BR%\n 1 The project should now build fine.\n%BR%%BR%%BR%%BR%\n \nYou will need to repeat these steps for each association until you have a completed Entity Data Model.\n%BR%%BR%%BR%%BR%" . . . . . . . . "VirtIngresAssociations" . . . . "VirtIngresAssociations" . "b7b219399a772c49f705a1783182e966" . "VirtIngresAssociations" .