The Association model is used to describe the relationship between different Entity Types in the OData model.
Let's look at a concrete example:
Principal Entity: Represents the leading end of the association.
Cardinality: Specifies the relationship between the subject entity type and the dependent entity type. Press F4 or click to select from list.
The multiplicity of associations is as follows:
- 0: 0 . .1: Only one instance occurs, 0 is also allowed.
- 1: One-to-one relationship. Only one instance of association is allowed at any one time.
- N: 1 . . n: One-to-many relationship. One or more instances can appear.
- M: 0 . .n: zero-to-many relationship. Zero or more instances can appear.
Specify the following parameters for the referential constraint ( referential constraints
) to associate each key of the principal entity type with an attribute of the dependent entity type:
- Principal key: Press F4 to select a key attribute in the principal entity type.
- Dependent property: Press F4 to select the property that specifies the type of dependent entity.
An example of Referential Constraints is as follows:
Referential constraints (Referential Constraints) can be used to specify foreign key relationships for 1:1 or 1:n associations.
An Association Set groups a series of association instances in the same way that an Entity Set groups instances of an entity type. Therefore, it specifies the relationship between two entity sets based on the respective entity types of the underlying association.
Suppose there is a 1:n association Author_To_Books
based on entity types Author and Book, there may be an Association Set WrittenBy
for Entity Set Authors and Books, and another Association Set FictionWrittenBy, For Entity Set FictionAuthors and FictionBooks.
This means that if you follow the navigation link of the Authors Feed entry at runtime, it will generate the Books Feed, while following the link to the FictionAuthors Feed entry will generate the FictionBooks feed.
Although both 在结构上是相等的
, since they are based on the same entity type, have different semantics and may contain different numbers of entries.
**粗体** _斜体_ [链接](http://example.com) `代码` - 列表 > 引用
。你还可以使用@
来通知其他用户。