|
28 | 28 | ## Examples
|
29 | 29 | The following example shows how to use the <xref:System.Data.Services.Client.DataServiceContext> generated by the Add Service Reference tool to implicitly execute a query against the Northwind data service that returns all customers. The URI of the requested `Customers` entity set is determined automatically by the context. The query is executed implicitly when the enumeration occurs. The Northwind data service is created when you complete the [!INCLUDE[ssAstoria](~/includes/ssastoria-md.md)] .
|
30 | 30 |
|
31 |
| - [!code-csharp[Astoria Northwind Client#GetAllCustomers](~/samples/snippets/csharp/VS_Snippets_Misc/astoria northwind client/cs/source.cs#getallcustomers)] |
32 |
| - [!code-vb[Astoria Northwind Client#GetAllCustomers](~/samples/snippets/visualbasic/VS_Snippets_Misc/astoria northwind client/vb/source.vb#getallcustomers)] |
| 31 | + [!code-csharp[Astoria Northwind Client#GetAllCustomers](~/samples/snippets/csharp/VS_Snippets_Misc/astoria_northwind_client/cs/source.cs#getallcustomers)] |
| 32 | + [!code-vb[Astoria Northwind Client#GetAllCustomers](~/samples/snippets/visualbasic/VS_Snippets_Misc/astoria_northwind_client/vb/source.vb#getallcustomers)] |
33 | 33 |
|
34 | 34 | ]]></format>
|
35 | 35 | </remarks>
|
|
116 | 116 | ## Examples
|
117 | 117 | The following example shows how to use the <xref:System.Data.Services.Client.DataServiceContext.AddLink%2A> and <xref:System.Data.Services.Client.DataServiceContext.SetLink%2A> methods to create links that define relationships. In this example, the navigation properties on the `Order_Details` object are also explicitly set. This example uses the <xref:System.Data.Services.Client.DataServiceContext> generated by the Add Service Reference tool based on the Northwind data service, which is created when you complete the [!INCLUDE[ssAstoria](~/includes/ssastoria-md.md)] .
|
118 | 118 |
|
119 |
| - [!code-csharp[Astoria Northwind Client#AddOrderDetailToOrder](~/samples/snippets/csharp/VS_Snippets_Misc/astoria northwind client/cs/source.cs#addorderdetailtoorder)] |
120 |
| - [!code-vb[Astoria Northwind Client#AddOrderDetailToOrder](~/samples/snippets/visualbasic/VS_Snippets_Misc/astoria northwind client/vb/source.vb#addorderdetailtoorder)] |
| 119 | + [!code-csharp[Astoria Northwind Client#AddOrderDetailToOrder](~/samples/snippets/csharp/VS_Snippets_Misc/astoria_northwind_client/cs/source.cs#addorderdetailtoorder)] |
| 120 | + [!code-vb[Astoria Northwind Client#AddOrderDetailToOrder](~/samples/snippets/visualbasic/VS_Snippets_Misc/astoria_northwind_client/vb/source.vb#addorderdetailtoorder)] |
121 | 121 |
|
122 | 122 | ]]></format>
|
123 | 123 | </remarks>
|
|
526 | 526 | ## Examples
|
527 | 527 | The following example shows how to execute an asynchronous query by calling the <xref:System.Data.Services.Client.DataServiceQuery%601.BeginExecute%2A> method to start the query. The inline delegate calls the <xref:System.Data.Services.Client.DataServiceQuery%601.EndExecute%2A> method to display the query results. This example uses the <xref:System.Data.Services.Client.DataServiceContext> generated by the Add Service Reference tool based on the Northwind data service, which is created when you complete the [!INCLUDE[ssAstoria](~/includes/ssastoria-md.md)] .
|
528 | 528 |
|
529 |
| - [!code-csharp[Astoria Northwind Client#ExecuteQueryAsync](~/samples/snippets/csharp/VS_Snippets_Misc/astoria northwind client/cs/source.cs#executequeryasync)] |
530 |
| - [!code-vb[Astoria Northwind Client#ExecuteQueryAsync](~/samples/snippets/visualbasic/VS_Snippets_Misc/astoria northwind client/vb/source.vb#executequeryasync)] |
| 529 | + [!code-csharp[Astoria Northwind Client#ExecuteQueryAsync](~/samples/snippets/csharp/VS_Snippets_Misc/astoria_northwind_client/cs/source.cs#executequeryasync)] |
| 530 | + [!code-vb[Astoria Northwind Client#ExecuteQueryAsync](~/samples/snippets/visualbasic/VS_Snippets_Misc/astoria_northwind_client/vb/source.vb#executequeryasync)] |
531 | 531 |
|
532 | 532 | ]]></format>
|
533 | 533 | </remarks>
|
|
1220 | 1220 | ## Examples
|
1221 | 1221 | The following example shows how to execute an asynchronous query by calling the <xref:System.Data.Services.Client.DataServiceQuery%601.BeginExecute%2A> method to start the query. The inline delegate calls the <xref:System.Data.Services.Client.DataServiceQuery%601.EndExecute%2A> method to display the query results. This example uses the <xref:System.Data.Services.Client.DataServiceContext> generated by the Add Service Reference tool based on the Northwind data service, which is created when you complete the [!INCLUDE[ssAstoria](~/includes/ssastoria-md.md)] .
|
1222 | 1222 |
|
1223 |
| - [!code-csharp[Astoria Northwind Client#ExecuteQueryAsync](~/samples/snippets/csharp/VS_Snippets_Misc/astoria northwind client/cs/source.cs#executequeryasync)] |
1224 |
| - [!code-vb[Astoria Northwind Client#ExecuteQueryAsync](~/samples/snippets/visualbasic/VS_Snippets_Misc/astoria northwind client/vb/source.vb#executequeryasync)] |
| 1223 | + [!code-csharp[Astoria Northwind Client#ExecuteQueryAsync](~/samples/snippets/csharp/VS_Snippets_Misc/astoria_northwind_client/cs/source.cs#executequeryasync)] |
| 1224 | + [!code-vb[Astoria Northwind Client#ExecuteQueryAsync](~/samples/snippets/visualbasic/VS_Snippets_Misc/astoria_northwind_client/vb/source.vb#executequeryasync)] |
1225 | 1225 |
|
1226 | 1226 | ]]></format>
|
1227 | 1227 | </remarks>
|
|
1495 | 1495 | ## Examples
|
1496 | 1496 | This example uses a `do…while` loop to load `Customers` entities from a paged results from the data service. The <xref:System.Data.Services.Client.DataServiceContext.Execute%2A> method is called by using the next link URI to receive the next page of data.
|
1497 | 1497 |
|
1498 |
| - [!code-csharp[Astoria Northwind Client#GetCustomersPaged](~/samples/snippets/csharp/VS_Snippets_Misc/astoria northwind client/cs/source.cs#getcustomerspaged)] |
1499 |
| - [!code-vb[Astoria Northwind Client#GetCustomersPaged](~/samples/snippets/visualbasic/VS_Snippets_Misc/astoria northwind client/vb/source.vb#getcustomerspaged)] |
| 1498 | + [!code-csharp[Astoria Northwind Client#GetCustomersPaged](~/samples/snippets/csharp/VS_Snippets_Misc/astoria_northwind_client/cs/source.cs#getcustomerspaged)] |
| 1499 | + [!code-vb[Astoria Northwind Client#GetCustomersPaged](~/samples/snippets/visualbasic/VS_Snippets_Misc/astoria_northwind_client/vb/source.vb#getcustomerspaged)] |
1500 | 1500 |
|
1501 | 1501 | ]]></format>
|
1502 | 1502 | </remarks>
|
|
1552 | 1552 | ## Examples
|
1553 | 1553 | The following example shows how to call the <xref:System.Data.Services.Client.DataServiceContext.ExecuteBatch*> method to execute an array of <xref:System.Data.Services.Client.DataServiceRequest%601> objects that contains queries that return both `Customers` and `Products` objects from the Northwind data service. The collection of <xref:System.Data.Services.Client.QueryOperationResponse%601> objects in the returned <xref:System.Data.Services.Client.DataServiceResponse> is enumerated, and the collection of objects that is contained in each <xref:System.Data.Services.Client.QueryOperationResponse%601> is also enumerated. This example uses the <xref:System.Data.Services.Client.DataServiceContext> generated by the Add Service Reference tool based on the Northwind data service, which is created when you complete the [!INCLUDE[ssAstoria](~/includes/ssastoria-md.md)] .
|
1554 | 1554 |
|
1555 |
| - [!code-csharp[Astoria Northwind Client#BatchQuery](~/samples/snippets/csharp/VS_Snippets_Misc/astoria northwind client/cs/source.cs#batchquery)] |
1556 |
| - [!code-vb[Astoria Northwind Client#BatchQuery](~/samples/snippets/visualbasic/VS_Snippets_Misc/astoria northwind client/vb/source.vb#batchquery)] |
| 1555 | + [!code-csharp[Astoria Northwind Client#BatchQuery](~/samples/snippets/csharp/VS_Snippets_Misc/astoria_northwind_client/cs/source.cs#batchquery)] |
| 1556 | + [!code-vb[Astoria Northwind Client#BatchQuery](~/samples/snippets/visualbasic/VS_Snippets_Misc/astoria_northwind_client/vb/source.vb#batchquery)] |
1557 | 1557 |
|
1558 | 1558 | ]]></format>
|
1559 | 1559 | </remarks>
|
|
2012 | 2012 | ## Examples
|
2013 | 2013 | The following example shows how to explicitly load the `Customers` object that is related to each returned `Orders` instance. This example uses the <xref:System.Data.Services.Client.DataServiceContext> generated by the Add Service Reference tool based on the Northwind data service, which is created when you complete the [!INCLUDE[ssAstoria](~/includes/ssastoria-md.md)] .
|
2014 | 2014 |
|
2015 |
| - [!code-csharp[Astoria Northwind Client#LoadRelatedOrderCustomer](~/samples/snippets/csharp/VS_Snippets_Misc/astoria northwind client/cs/source.cs#loadrelatedordercustomer)] |
2016 |
| - [!code-vb[Astoria Northwind Client#LoadRelatedOrderCustomer](~/samples/snippets/visualbasic/VS_Snippets_Misc/astoria northwind client/vb/source.vb#loadrelatedordercustomer)] |
| 2015 | + [!code-csharp[Astoria Northwind Client#LoadRelatedOrderCustomer](~/samples/snippets/csharp/VS_Snippets_Misc/astoria_northwind_client/cs/source.cs#loadrelatedordercustomer)] |
| 2016 | + [!code-vb[Astoria Northwind Client#LoadRelatedOrderCustomer](~/samples/snippets/visualbasic/VS_Snippets_Misc/astoria_northwind_client/vb/source.vb#loadrelatedordercustomer)] |
2017 | 2017 |
|
2018 | 2018 | ]]></format>
|
2019 | 2019 | </remarks>
|
|
2101 | 2101 | ## Examples
|
2102 | 2102 | This example returns related `Orders` entities with each `Customers` entity and uses a `do…while` loop to load `Customers` entities pages and a nested `while` loop to load pages of related `Orders` entities from the data service. The <xref:System.Data.Services.Client.DataServiceContext.LoadProperty%2A> method is used to load pages of related `Orders` entities.
|
2103 | 2103 |
|
2104 |
| - [!code-csharp[Astoria Northwind Client#GetCustomersPagedNested](~/samples/snippets/csharp/VS_Snippets_Misc/astoria northwind client/cs/source.cs#getcustomerspagednested)] |
2105 |
| - [!code-vb[Astoria Northwind Client#GetCustomersPagedNested](~/samples/snippets/visualbasic/VS_Snippets_Misc/astoria northwind client/vb/source.vb#getcustomerspagednested)] |
| 2104 | + [!code-csharp[Astoria Northwind Client#GetCustomersPagedNested](~/samples/snippets/csharp/VS_Snippets_Misc/astoria_northwind_client/cs/source.cs#getcustomerspagednested)] |
| 2105 | + [!code-vb[Astoria Northwind Client#GetCustomersPagedNested](~/samples/snippets/visualbasic/VS_Snippets_Misc/astoria_northwind_client/vb/source.vb#getcustomerspagednested)] |
2106 | 2106 |
|
2107 | 2107 | ]]></format>
|
2108 | 2108 | </remarks>
|
|
2495 | 2495 | ## Examples
|
2496 | 2496 | The following example shows how to use the <xref:System.Data.Services.Client.DataServiceContext.AddLink%2A> and <xref:System.Data.Services.Client.DataServiceContext.SetLink%2A> methods to create links that define relationships. In this example, the navigation properties on the `Order_Details` object are also explicitly set.
|
2497 | 2497 |
|
2498 |
| - [!code-csharp[Astoria Northwind Client#AddOrderDetailToOrder](~/samples/snippets/csharp/VS_Snippets_Misc/astoria northwind client/cs/source.cs#addorderdetailtoorder)] |
2499 |
| - [!code-vb[Astoria Northwind Client#AddOrderDetailToOrder](~/samples/snippets/visualbasic/VS_Snippets_Misc/astoria northwind client/vb/source.vb#addorderdetailtoorder)] |
| 2498 | + [!code-csharp[Astoria Northwind Client#AddOrderDetailToOrder](~/samples/snippets/csharp/VS_Snippets_Misc/astoria_northwind_client/cs/source.cs#addorderdetailtoorder)] |
| 2499 | + [!code-vb[Astoria Northwind Client#AddOrderDetailToOrder](~/samples/snippets/visualbasic/VS_Snippets_Misc/astoria_northwind_client/vb/source.vb#addorderdetailtoorder)] |
2500 | 2500 |
|
2501 | 2501 | ]]></format>
|
2502 | 2502 | </remarks>
|
|
2813 | 2813 | ## Examples
|
2814 | 2814 | The following example retrieves and modifies an existing object and then calls the <xref:System.Data.Services.Client.DataServiceContext.UpdateObject%2A> method on the <xref:System.Data.Services.Client.DataServiceContext> to mark the item in the context as updated. An HTTP MERGE message is sent to the data service when <xref:System.Data.Services.Client.DataServiceContext.SaveChanges%2A> is called. This example uses the <xref:System.Data.Services.Client.DataServiceContext> generated by the Add Service Reference tool based on the Northwind data service, which is created when you complete the [!INCLUDE[ssAstoria](~/includes/ssastoria-md.md)] .
|
2815 | 2815 |
|
2816 |
| - [!code-csharp[Astoria Northwind Client#ModifyCustomer](~/samples/snippets/csharp/VS_Snippets_Misc/astoria northwind client/cs/source.cs#modifycustomer)] |
2817 |
| - [!code-vb[Astoria Northwind Client#ModifyCustomer](~/samples/snippets/visualbasic/VS_Snippets_Misc/astoria northwind client/vb/source.vb#modifycustomer)] |
| 2816 | + [!code-csharp[Astoria Northwind Client#ModifyCustomer](~/samples/snippets/csharp/VS_Snippets_Misc/astoria_northwind_client/cs/source.cs#modifycustomer)] |
| 2817 | + [!code-vb[Astoria Northwind Client#ModifyCustomer](~/samples/snippets/visualbasic/VS_Snippets_Misc/astoria_northwind_client/vb/source.vb#modifycustomer)] |
2818 | 2818 |
|
2819 | 2819 | ]]></format>
|
2820 | 2820 | </remarks>
|
|
0 commit comments