Skip to content

Commit a3966c7

Browse files
committed
entity->resource
1 parent ec0c55c commit a3966c7

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

graph/patterns/alternate-key.md

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2,14 +2,14 @@
22

33
Microsoft Graph API Design Pattern
44

5-
*The Alternate Key Pattern provides the ability to query for a single, specific entity identifiable through an alternative attribute (called key) that is not its unique identifier*
5+
*The Alternate Key Pattern provides the ability to query for a single, specific resource identifiable through an alternative attribute (called key) that is not its unique identifier*
66

77
## Problem
88
--------
99

10-
All entities in our system are identified by an [UUID (Universally Unique Identifier)](https://en.wikipedia.org/wiki/Universally_unique_identifier) - which guarantees uniqueness. Often though, that same entity can also be uniquely identified by an alternative, more convenient attribute.
10+
All entities in our system are identified by an [UUID (Universally Unique Identifier)](https://en.wikipedia.org/wiki/Universally_unique_identifier) - which guarantees uniqueness. Often though, that same resource can also be uniquely identified by an alternative, more convenient attribute.
1111

12-
Take a look at the `user` entity: while the `id` remains a perfectly valid way to get the entity details, the `mail` address is also an unique attribute that could be used to identify it.
12+
Take a look at the `user` resource: while the `id` remains a perfectly valid way to get the resource details, the `mail` address is also an unique attribute that could be used to identify it.
1313

1414
While it is still possible to use the oData filter, such as
1515

@@ -19,15 +19,15 @@ While it is still possible to use the oData filter, such as
1919
## Solution
2020
--------
2121

22-
oData offers entity addressing via an alternate key using the same parentheses-style convention as for the canonical key, with one difference: single-part alternate keys MUST specify the key property name to unambiguously determine the alternate key.
22+
oData offers resource addressing via an alternate key using the same parentheses-style convention as for the canonical key, with one difference: single-part alternate keys MUST specify the key property name to unambiguously determine the alternate key.
2323

2424
https://graph.microsoft.com/v1.0/users(0) - Retrieves the employee with ID = 0
2525
https://graph.microsoft.com/v1.0/users(email='[email protected]') Retrieves the employee with the email matching `[email protected]`
2626

2727
## When to Use this Pattern
2828
------------------------
2929

30-
This pattern works and makes sense when the alternate key is good enough to identify a single entity and provides an useful alternative to the client; while it does not work if the resultset has more than one element.
30+
This pattern works and makes sense when the alternate key is good enough to identify a single resource and provides an useful alternative to the client; while it does not work if the resultset has more than one element.
3131

3232
In such case, we **strongly** advice to throw an exception and encourage the user to use `$filter` rather than returning the first result of the query
3333

0 commit comments

Comments
 (0)