Skip to content

Commit b46c94d

Browse files
committed
problem and solution
1 parent 99d426a commit b46c94d

File tree

2 files changed

+42
-41
lines changed

2 files changed

+42
-41
lines changed

graph/patterns/navigation-property.md

Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,42 @@
1+
# Navigation Property
2+
3+
Microsoft Graph API Design Pattern
4+
5+
*A navigation property is used to identify a relationship between two resources.*
6+
7+
## Problem
8+
--------
9+
10+
Resources often contain information that identifies other related resources. Usually that information is contained in a returned representation as an id value. In order for a client to access the related resource it must request the primary resource, read the id value of the related resource and then construct a URL to the related resource using the Id value. This requires at least two round trips and requires the client know how to construct the URL to the related resource.
11+
12+
## Solution
13+
--------
14+
15+
Navigation properties are an OData convention that allows an API designer to create a special kind of property in a model that references an related entity. In the HTTP API this property name translates to a path segment that can be appended to the URL of the primary resource in order to access a representation of the related resource. This prevents the client from needing to know any additional information on how to construct the URL to the related resource and the client does not need to retrieve the primary resource if it is only interested in the related resource. It is the responsibility of the API implementation to determine the Id of the related resource and return the representation of the related entity.
16+
17+
Additionally, using the OData Expand query parameter, related entities can be transcluded into the primary entity so both can be retrieved in a single round trip.
18+
19+
## Issues and Considerations
20+
-------------------------
21+
22+
In the current Microsoft Graph implementation, support for navigation properties is limited to entities within the same backend service or the user entity.
23+
 
24+
Implementing support for accessing the "$ref" of a navigation property allows a caller to return just the URL of related resource. e.g. `/user/23/manager/$ref`. This is useful when a client wishes to identity the related resource but doesn't need all of its properties.
25+
26+
## When to Use this Pattern
27+
------------------------
28+
29+
The use of navigation properties is preferred over
30+
31+
 
32+
33+
## Example
34+
-------
35+
36+
*Provide a short example from real life*
37+
38+
 
39+
40+
 
41+
42+
 

graph/patterns/navigation-property/index.md

Lines changed: 0 additions & 41 deletions
This file was deleted.

0 commit comments

Comments
 (0)