简体   繁体   English

为什么Microsoft Graph API在URI中使用$ ref?

[英]Why is the Microsoft Graph API using $ref in the URI?

I have noticed that the Microsoft Graph API is very often using $ref in the URIs. 我注意到Microsoft Graph API经常在URI中使用$ref

For example a member can be added to an Office 365 Group using the following HTTP request: 例如, 可以使用以下HTTP请求将成员添加到Office 365组

POST /groups/{id}/members/$ref

Why is the $ref suffix used? 为什么使用$ref后缀? Does this provide any value or advantage? 这会提供任何价值或优势吗? Does this have some special meaning in this case? 在这种情况下,这是否有特殊含义?

Microsoft is implementing OData . 微软正在实施OData Section 4.4 Addressing References between Entities explains $ref : 4.4处理实体之间的引用说明$ref

OData services are based on a data model that supports relationships as first class constructs. OData服务基于支持作为一流构造的关系的数据模型。 For example, an OData service could expose a collection of Products entities each of which are related to a Category entity. 例如,OData服务可以公开产品实体的集合,每个产品实体都与类别实体相关。

References between entities are addressable in OData just like entities themselves are (as described above) by appending a navigation property name followed by /$ref to the entity URL. 实体之间的引用在OData中可寻址,就像实体本身(如上所述)一样,方法是在实体URL后面附加导航属性名称,后跟/ $ ref。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM