Skip to content

Commit cc8a934

Browse files
Update coreTypes.md
1 parent 5818436 commit cc8a934

File tree

1 file changed

+44
-4
lines changed

1 file changed

+44
-4
lines changed

graph/articles/coreTypes.md

+44-4
Original file line numberDiff line numberDiff line change
@@ -19,8 +19,8 @@ The following types are identified as core types, and will require strong justif
1919
Instead of adding a structural property to the existing type (`user`, `group` or `device`), create a new type that models the information captured in the proposed structural property(s).
2020
Then, do one of the following:
2121
- Add a navigation property on the existing type to the new type, containing the new type.
22-
- Contain the new type in an entity set elsewhere, and add a navigation property to the existing type on the new type.
2322
- Contain the new type in an entity set elsewhere, and add a navigation property to the new type on the existing type.
23+
- Contain the new type in an entity set elsewhere, and add a navigation property to the existing type on the new type.
2424

2525
## Example:
2626

@@ -39,19 +39,59 @@ Don't add new properties to core types such as `user`.
3939

4040
### Do:
4141

42-
First, create a new type that models the information captured in the desired structural property(s).
42+
Do one of the following:
4343

44+
#### Add a navigation property on the existing type to the new type, containing the new type.
45+
46+
Define the new entity type:
4447
```xml
4548
<EntityType name="bankAccountInformation">
4649
<Property Name="accountNumber" Type="Edm.string"/>
4750
<Property Name="routingNumber" Type="Edm.string"/>
4851
</EntityType>
4952
```
5053

51-
Then, for example, add a navigation property on the existing type, containing the new type:
52-
54+
Add a contained navigation from user to the new entity type:
5355
```xml
5456
<EntityType name="user">
5557
<NavigationProperty Name="bankAccountInformation" Type="bankAccountInformation" ContainsTarget="true"/>
5658
</EntityType>
5759
```
60+
61+
#### Contain the new type in an entity set elsewhere, and add a navigation property to the new type on the existing type.
62+
63+
Define the new entity type:
64+
```xml
65+
<EntityType name="bankAccountInformation">
66+
<Property Name="accountNumber" Type="Edm.string"/>
67+
<Property Name="routingNumber" Type="Edm.string"/>
68+
</EntityType>
69+
```
70+
71+
Contain the new entity type in an entity set or singleton:
72+
```xml
73+
<EntitySet Name="bankAccountInformations" EntityType="bankAccountInformation">
74+
```
75+
76+
Add a navigation from user to the new type:
77+
```xml
78+
<EntityType name="user">
79+
<NavigationProperty Name="bankAccountInformation" Type="bankAccountInformation" />
80+
</EntityType>
81+
```
82+
83+
#### Contain the new type in an entity set elsewhere, and add a navigation property to the existing type on the new type.
84+
85+
Define the new entity type, with a navigation to the user:
86+
```xml
87+
<EntityType name="bankAccountInformation">
88+
<Property Name="accountNumber" Type="Edm.string"/>
89+
<Property Name="routingNumber" Type="Edm.string"/>
90+
<NavigationProperty Name="user" Type="microsoft.graph.user" />
91+
</EntityType>
92+
```
93+
94+
Contain the new entity type in an entity set or singleton:
95+
```xml
96+
<EntitySet Name="bankAccountInformations" EntityType="bankAccountInformation">
97+
```

0 commit comments

Comments
 (0)