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
In [!INCLUDE[ssODataShort](../../../../includes/ssodatashort-md.md)], you address any data exposed by the data model by using a URI. For example, the following URI returns a feed that is the Customers entity set, which contains entries for all instances of the Customer entity type:
Entities have special properties called entity keys. An entity key is used to uniquely identify a single entity in an entity set. This enables you to address a specific instance of an entity type in the entity set. For example, the following URI returns an entry for a specific instance of the Customer entity type that has a key value of `ALFKI`:
Primitive and complex properties of an entity instance can also be individually addressed. For example, the following URI returns an XML element that contains the `ContactName` property value for a specific Customer:
When you include the `$value` endpoint in the previous URI, only the value of the primitive property is returned in the response message. The following example returns only the string "Maria Anders" without the XML element:
Relationships between entities are defined in the data model by associations. These associations enable you to address related entities by using navigation properties of an entity instance. A navigation property can return either a single related entity, in the case of a many-to-one relationship, or a set of related entities, in the case of a one-to-many relationship. For example, the following URI returns a feed that is the set of all the Orders that are related to a specific Customer:
Relationships, which are usually bi-directional, are represented by a pair of navigation properties. As the reverse of the relationship shown in the previous example, the following URI returns a reference to the Customer entity to which a specific Order entity belongs:
[!INCLUDE[ssODataShort](../../../../includes/ssodatashort-md.md)] also enables you to address resources based on the results of query expressions. This makes it possible to filter sets of resources based on an evaluated expression. For example, the following URI filters the resources to return only the Orders for the specified Customer that have shipped since September 22, 1997:
For more information, see [OData: URI Conventions](https://www.odata.org/documentation/odata-version-2-0/uri-conventions/).
59
45
60
46
## System Query Options
61
47
[!INCLUDE[ssODataShort](../../../../includes/ssodatashort-md.md)] defines a set of system query options that you can use to perform traditional query operations against resources, such as filtering, sorting, and paging. For example, the following URI returns the set of all the `Order` entities, along with related `Order_Detail` entities, the postal codes of which do not end in `100`:
The entries in the returned feed are also ordered by the value of the ShipCity property of the orders.
68
52
69
53
[!INCLUDE[ssAstoria](../../../../includes/ssastoria-md.md)] supports the following [!INCLUDE[ssODataShort](../../../../includes/ssodatashort-md.md)] system query options:
70
54
71
55
|Query Option|Description|
72
56
|------------------|-----------------|
73
-
|`$orderby`|Defines a default sort order for entities in the returned feed. The following query orders the returned customers feed by county and city:<br /><br /> <https://services.odata.org/Northwind/Northwind.svc/Customers?$orderby=Country,City><br /><br />|
74
-
|`$top`|Specifies the number of entities to include in the returned feed. The following example skips the first 10 customers and then returns the next 10:<br /><br /> `http://services.odata.org/Northwind/Northwind.svc/Customers?$skip=10&$top=10`<br /><br />|
75
-
|`$skip`|Specifies the number of entities to skip before starting to return entities in the feed. The following example skips the first 10 customers and then returns the next 10:<br /><br /> `http://services.odata.org/Northwind/Northwind.svc/Customers?$skip=10&$top=10`<br /><br />|
76
-
|`$filter`|Defines an expression that filters the entities returned in the feed based on specific criteria. This query option supports a set of logical comparison operators, arithmetic operators, and predefined query functions that are used to evaluate the filter expression. The following example returns all orders the postal codes of which do not end in 100:<br /><br /> `http://services.odata.org/Northwind/Northwind.svc/Orders?$filter=not endswith(ShipPostalCode,'100')`<br /><br />|
77
-
|`$expand`|Specifies which related entities are returned by the query. Related entities are included as either a feed or an entry inline with the entity returned by the query. The following example returns the order for the customer 'ALFKI' along with the item details for each order:<br /><br /> `http://services.odata.org/Northwind/Northwind.svc/Customers('ALFKI')/Orders?$expand=Order_Details`<br /><br />|
78
-
|`$select`|Specifies a projection that defines the properties of the entity are returned in the projection. By default, all properties of an entity are returned in a feed. The following query returns only three properties of the `Customer` entity:<br /><br /> `http://services.odata.org/Northwind/Northwind.svc/Customers?$select=CustomerID,CompanyName,City`<br /><br />|
57
+
|`$orderby`|Defines a default sort order for entities in the returned feed. The following query orders the returned customers feed by county and city:<br /><br /> <https://services.odata.org/Northwind/Northwind.svc/Customers?$orderby=Country,City>|
58
+
|`$top`|Specifies the number of entities to include in the returned feed. The following example skips the first 10 customers and then returns the next 10:<br /><br /> <https://services.odata.org/Northwind/Northwind.svc/Customers?$skip=10&$top=10>|
59
+
|`$skip`|Specifies the number of entities to skip before starting to return entities in the feed. The following example skips the first 10 customers and then returns the next 10:<br /><br /> <https://services.odata.org/Northwind/Northwind.svc/Customers?$skip=10&$top=10>|
60
+
|`$filter`|Defines an expression that filters the entities returned in the feed based on specific criteria. This query option supports a set of logical comparison operators, arithmetic operators, and predefined query functions that are used to evaluate the filter expression. The following example returns all orders the postal codes of which do not end in 100:<br /><br /> <https://services.odata.org/Northwind/Northwind.svc/Orders?$filter=not endswith(ShipPostalCode,'100')>|
61
+
|`$expand`|Specifies which related entities are returned by the query. Related entities are included as either a feed or an entry inline with the entity returned by the query. The following example returns the order for the customer 'ALFKI' along with the item details for each order:<br /><br /> <https://services.odata.org/Northwind/Northwind.svc/Customers('ALFKI')/Orders?$expand=Order_Details>|
62
+
|`$select`|Specifies a projection that defines the properties of the entity are returned in the projection. By default, all properties of an entity are returned in a feed. The following query returns only three properties of the `Customer` entity:<br /><br /> <https://services.odata.org/Northwind/Northwind.svc/Customers?$select=CustomerID,CompanyName,City>|
79
63
|`$inlinecount`|Requests that a count of the number of entities returned in the feed be included with the feed.|
80
64
81
-
For more information, see section `4. Query String Options` at [OData: URI Conventions](https://www.odata.org/documentation/odata-version-2-0/uri-conventions/).
82
-
83
65
## Addressing Relationships
84
66
In addition to addressing entity sets and entity instances, [!INCLUDE[ssODataShort](../../../../includes/ssodatashort-md.md)] also enables you to address the associations that represent relationships between entities. This functionality is required to be able to create or change a relationship between two entity instances, such as the shipper that is related to a given order in the Northwind sample database. [!INCLUDE[ssODataShort](../../../../includes/ssodatashort-md.md)] supports a `$link` operator to specifically address the associations between entities. For example, the following URI is specified in an HTTP PUT request message to change the shipper for the specified order to a new shipper.
For more information, see section `3.2. Addressing Links between Entries` at [OData: URI Conventions](https://www.odata.org/documentation/odata-version-2-0/uri-conventions/).
[!INCLUDE[ssODataShort](../../../../includes/ssodatashort-md.md)] exposes data as resources that are addressable by URIs. The resource paths are constructed based on the entity-relationship conventions of the Entity Data Model. In this model, entities represent operational units of data in an application domain, such as customers, orders, items, and products. For more information, see [Entity Data Model](../adonet/entity-data-model.md).
14
14
15
-
In [!INCLUDE[ssODataShort](../../../../includes/ssodatashort-md.md)], you address entity resources as an entity set that contains instances of entity types. For example, the URI `http://services.odata.org/Northwind/Northwind.svc/Customers('ALFKI')/Orders` returns all of the orders from the `Northwind` data service that are related to the customer with a `CustomerID` value of `ALFKI.`
15
+
In [!INCLUDE[ssODataShort](../../../../includes/ssodatashort-md.md)], you address entity resources as an entity set that contains instances of entity types. For example, the URI <https://services.odata.org/Northwind/Northwind.svc/Customers('ALFKI')/Orders> returns all of the orders from the `Northwind` data service that are related to the customer with a `CustomerID` value of `ALFKI.`
16
16
17
-
Query expressions enable you to perform traditional query operations against resources, such as filtering, sorting, and paging. For example, the URI `http://services.odata.org/Northwind/Northwind.svc/Customers('ALFKI')/Orders?$filter=Freight gt 50` filters the resources to return only the orders with a freight cost of more than $50. For more information, see [Accessing Data Service Resources](accessing-data-service-resources-wcf-data-services.md).
17
+
Query expressions enable you to perform traditional query operations against resources, such as filtering, sorting, and paging. For example, the URI <https://services.odata.org/Northwind/Northwind.svc/Customers('ALFKI')/Orders?$filter=Freight gt 50> filters the resources to return only the orders with a freight cost of more than $50. For more information, see [Accessing Data Service Resources](accessing-data-service-resources-wcf-data-services.md).
18
18
19
19
## Interoperable Data Access
20
20
[!INCLUDE[ssODataShort](../../../../includes/ssodatashort-md.md)] builds on standard Internet protocols to make data services interoperable with applications that do not use the .NET Framework. Because you can use standard URIs to address data, your application can access and change data by using the semantics of representational state transfer (REST), specifically the standard HTTP verbs of GET, PUT, POST, and DELETE. This enables you to access these services from any client that can parse and access data that is transmitted over standard HTTP protocols.
Copy file name to clipboardExpand all lines: docs/framework/windows-workflow-foundation/consuming-odata-feeds-from-a-workflow.md
+1-1Lines changed: 1 addition & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -9,7 +9,7 @@ WCF Data Services is a component of the .NET Framework that enables you to creat
9
9
10
10
## Using the sample Northwind OData service
11
11
12
-
The examples in this topic use the sample Northwind data service located at [http://services.odata.org/Northwind/Northwind.svc/](https://go.microsoft.com/fwlink/?LinkID=187426). This service is provided as part of the [OData SDK](https://go.microsoft.com/fwlink/?LinkID=185248) and provides read-only access to the sample Northwind database. If write access is desired, or if a local WCF Data Service is desired, you can follow the steps of the [WCF Data Services Quickstart](https://go.microsoft.com/fwlink/?LinkID=131076) to create a local OData service that provides access to the Northwind database. If you follow the quickstart, substitute the local URI for the one provided in the example code in this topic.
12
+
The examples in this topic use the sample Northwind data service located at <https://services.odata.org/Northwind/Northwind.svc/>. This service is provided as part of the [OData SDK](https://go.microsoft.com/fwlink/?LinkID=185248) and provides read-only access to the sample Northwind database. If write access is desired, or if a local WCF Data Service is desired, you can follow the steps of the [WCF Data Services Quickstart](https://go.microsoft.com/fwlink/?LinkID=131076) to create a local OData service that provides access to the Northwind database. If you follow the quickstart, substitute the local URI for the one provided in the example code in this topic.
13
13
14
14
## Consuming an OData feed using the client libraries
0 commit comments