You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: graph/patterns/dictionary.md
+12-8Lines changed: 12 additions & 8 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -37,7 +37,9 @@ For more information, see the [OData reference](https://github.com/oasis-tcs/oda
37
37
38
38
## Examples
39
39
40
-
### Declaring a string dictionary
40
+
### String dictionary
41
+
42
+
#### CSDL declaration
41
43
The following example demonstrates defining a dictionary that can contain string values.
42
44
43
45
```xml
@@ -60,7 +62,7 @@ The following example demonstrates defining a dictionary that can contain string
60
62
Please note that schema validation will fail due to the casing of `Dictionary`.
61
63
This warning should be suppressed.
62
64
63
-
### Defining a dictionary property
65
+
####Defining a dictionary property
64
66
The following example shows defining a dictionary property, "userTags", on the item entity type.
65
67
66
68
```xml
@@ -70,7 +72,7 @@ The following example shows defining a dictionary property, "userTags", on the i
70
72
</EntityType>
71
73
```
72
74
73
-
### Reading a dictionary
75
+
####Reading a dictionary
74
76
Dictionaries are represented in JSON payloads as a JSON object, where the property names are comprised of the keys and their values are the corresponding key values.
75
77
76
78
The following example shows reading an item with a dictionary property named "userTags":
@@ -90,7 +92,7 @@ Response:
90
92
}
91
93
```
92
94
93
-
### Setting a dictionary value
95
+
####Setting a dictionary value
94
96
The following example shows setting a dictionary value. If "hairColor" already exists, it is updated, otherwise it is added.
95
97
96
98
```http
@@ -102,7 +104,7 @@ PATCH /item/userTags
102
104
}
103
105
```
104
106
105
-
### Deleting a dictionary value
107
+
####Deleting a dictionary value
106
108
A dictionary value can be removed by setting the value to null.
107
109
```http
108
110
PATCH /item/userTags
@@ -113,7 +115,9 @@ PATCH /item/userTags
113
115
}
114
116
```
115
117
116
-
### Declaring a complex typed dictionary
118
+
### Complex typed dictionary
119
+
120
+
#### CSDL declaration
117
121
Dictionaries can also contain complex types whose values may be constrained to a particular set of complex types.
118
122
119
123
The following example defines a complex type **roleSettings**, an **assignedRoleGroupDictionary** that contains **roleSettings**, and an **assignedRoles** property that uses the dictionary..
@@ -147,7 +151,7 @@ The following example defines a complex type **roleSettings**, an **assignedRole
147
151
</Schema>
148
152
```
149
153
150
-
### Reading a entity with a complex-typed dictionary
154
+
####Reading a entity with a complex-typed dictionary
151
155
152
156
The following example illustrates reading an entity containing the complex-typed dictionary "assignedRoles".
153
157
@@ -175,7 +179,7 @@ Response:
175
179
}
176
180
```
177
181
178
-
### Reading the dictionary property
182
+
####Reading the dictionary property
179
183
The following example shows getting just the "assignedRoles" dictionary property.
0 commit comments