Add relations to tables through extension
To enable rich and secure interactions with data in multiple tables, you must help guarantee referential integrity by defining relations that describe the link between two tables. By defining relations, you enable validation of the data that is entered and lookup capabilities for the related information.
You can add a new relation by extending a table.
In the following example, a new field, MyInventLocationId, is added to the InventTable table. This field is a reference to the InventLocation table that contains warehouses.
- In the new extension model, create an extension of the InventTable table.
- Create a new relation, just as you would create a relation on a regular table.
- Specify the Related Table, Relationship Type, and Cardinality properties, and any other properties that apply to the relation.
- Add the link by specifying the fields from the InventTable table and the InventLocation table that have the same value. In this case, the fields are MyInventLocationId in the InventTable table and InventLocationId in the InventLocation table.
The following illustration shows the new relation.
Troubleshooting
Navigation property methods not working
Issue - Navigation property methods do not work when a foreign key relation is created using a table extension. The compiler will not allow a call to a navigation method on the extended table.
Solution - Navigation methods are not supported at this time.
피드백
https://aka.ms/ContentUserFeedback
출시 예정: 2024년 내내 콘텐츠에 대한 피드백 메커니즘으로 GitHub 문제를 단계적으로 폐지하고 이를 새로운 피드백 시스템으로 바꿀 예정입니다. 자세한 내용은 다음을 참조하세요.다음에 대한 사용자 의견 제출 및 보기