Skip to content

fix: Underscore astoria snippets #2291

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 3 commits into from
Apr 12, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 5 additions & 5 deletions xml/System.Data.Services.Client/DataServiceCollection`1.xml
Original file line number Diff line number Diff line change
Expand Up @@ -37,12 +37,12 @@
## Examples
The following example is from the code-behind page for an Extensible Application Markup Language (XAML) page that defines the `SalesOrders` window in WPF. When the window is loaded, an <xref:System.Data.Services.Client.DataServiceCollection%601> is created based on the result of a query that returns customers with related objects, filtered by country. This result is bound to the <xref:System.Windows.FrameworkElement.DataContext%2A> property of the <xref:System.Windows.Controls.StackPanel> that is the root layout control for the WPF window.

[!code-csharp[Astoria Northwind Client#WpfDataBinding](~/samples/snippets/csharp/VS_Snippets_Misc/astoria northwind client/cs/customerorderswpf.xaml.cs#wpfdatabinding)]
[!code-vb[Astoria Northwind Client#WpfDataBinding](~/samples/snippets/visualbasic/VS_Snippets_Misc/astoria northwind client/vb/customerorderswpf.xaml.vb#wpfdatabinding)]
[!code-csharp[Astoria Northwind Client#WpfDataBinding](~/samples/snippets/csharp/VS_Snippets_Misc/astoria_northwind_client/cs/customerorderswpf.xaml.cs#wpfdatabinding)]
[!code-vb[Astoria Northwind Client#WpfDataBinding](~/samples/snippets/visualbasic/VS_Snippets_Misc/astoria_northwind_client/vb/customerorderswpf.xaml.vb#wpfdatabinding)]

The following is the XAML that defines the `SalesOrders` window in WPF for the previous example.

[!code-xaml[Astoria Northwind Client#WpfDataBindingXaml](~/samples/snippets/visualbasic/VS_Snippets_Misc/astoria northwind client/vb/customerorderswpf.xaml#wpfdatabindingxaml)]
[!code-xaml[Astoria Northwind Client#WpfDataBindingXaml](~/samples/snippets/visualbasic/VS_Snippets_Misc/astoria_northwind_client/vb/customerorderswpf.xaml#wpfdatabindingxaml)]

]]></format>
</remarks>
Expand Down Expand Up @@ -408,8 +408,8 @@
## Examples
The following example is from the code-behind page for an Extensible Application Markup Language (XAML) page that defines the `SalesOrders` window in WPF. When the window is loaded, a <xref:System.Data.Services.Client.DataServiceCollection%601> is created based on the result of a query that returns customers, filtered by country. All of the pages of this paged result are loaded, along with the related orders, and are bound to the <xref:System.Windows.FrameworkElement.DataContext%2A> property of the <xref:System.Windows.Controls.StackPanel> that is the root layout control for the WPF window. For more information, see [How to: Bind Data to Windows Presentation Foundation Elements](~/docs/framework/data/wcf/bind-data-to-wpf-elements-wcf-data-services.md).

[!code-csharp[Astoria Northwind Client#BindPagedData](~/samples/snippets/csharp/VS_Snippets_Misc/astoria northwind client/cs/customerorderswpf3.xaml.cs#bindpageddata)]
[!code-vb[Astoria Northwind Client#BindPagedData](~/samples/snippets/visualbasic/VS_Snippets_Misc/astoria northwind client/vb/customerorderswpf3.xaml.vb#bindpageddata)]
[!code-csharp[Astoria Northwind Client#BindPagedData](~/samples/snippets/csharp/VS_Snippets_Misc/astoria_northwind_client/cs/customerorderswpf3.xaml.cs#bindpageddata)]
[!code-vb[Astoria Northwind Client#BindPagedData](~/samples/snippets/visualbasic/VS_Snippets_Misc/astoria_northwind_client/vb/customerorderswpf3.xaml.vb#bindpageddata)]

]]></format>
</remarks>
Expand Down
40 changes: 20 additions & 20 deletions xml/System.Data.Services.Client/DataServiceContext.xml
Original file line number Diff line number Diff line change
Expand Up @@ -28,8 +28,8 @@
## Examples
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)] .

[!code-csharp[Astoria Northwind Client#GetAllCustomers](~/samples/snippets/csharp/VS_Snippets_Misc/astoria northwind client/cs/source.cs#getallcustomers)]
[!code-vb[Astoria Northwind Client#GetAllCustomers](~/samples/snippets/visualbasic/VS_Snippets_Misc/astoria northwind client/vb/source.vb#getallcustomers)]
[!code-csharp[Astoria Northwind Client#GetAllCustomers](~/samples/snippets/csharp/VS_Snippets_Misc/astoria_northwind_client/cs/source.cs#getallcustomers)]
[!code-vb[Astoria Northwind Client#GetAllCustomers](~/samples/snippets/visualbasic/VS_Snippets_Misc/astoria_northwind_client/vb/source.vb#getallcustomers)]

]]></format>
</remarks>
Expand Down Expand Up @@ -116,8 +116,8 @@
## Examples
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)] .

[!code-csharp[Astoria Northwind Client#AddOrderDetailToOrder](~/samples/snippets/csharp/VS_Snippets_Misc/astoria northwind client/cs/source.cs#addorderdetailtoorder)]
[!code-vb[Astoria Northwind Client#AddOrderDetailToOrder](~/samples/snippets/visualbasic/VS_Snippets_Misc/astoria northwind client/vb/source.vb#addorderdetailtoorder)]
[!code-csharp[Astoria Northwind Client#AddOrderDetailToOrder](~/samples/snippets/csharp/VS_Snippets_Misc/astoria_northwind_client/cs/source.cs#addorderdetailtoorder)]
[!code-vb[Astoria Northwind Client#AddOrderDetailToOrder](~/samples/snippets/visualbasic/VS_Snippets_Misc/astoria_northwind_client/vb/source.vb#addorderdetailtoorder)]

]]></format>
</remarks>
Expand Down Expand Up @@ -526,8 +526,8 @@
## Examples
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)] .

[!code-csharp[Astoria Northwind Client#ExecuteQueryAsync](~/samples/snippets/csharp/VS_Snippets_Misc/astoria northwind client/cs/source.cs#executequeryasync)]
[!code-vb[Astoria Northwind Client#ExecuteQueryAsync](~/samples/snippets/visualbasic/VS_Snippets_Misc/astoria northwind client/vb/source.vb#executequeryasync)]
[!code-csharp[Astoria Northwind Client#ExecuteQueryAsync](~/samples/snippets/csharp/VS_Snippets_Misc/astoria_northwind_client/cs/source.cs#executequeryasync)]
[!code-vb[Astoria Northwind Client#ExecuteQueryAsync](~/samples/snippets/visualbasic/VS_Snippets_Misc/astoria_northwind_client/vb/source.vb#executequeryasync)]

]]></format>
</remarks>
Expand Down Expand Up @@ -1220,8 +1220,8 @@
## Examples
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)] .

[!code-csharp[Astoria Northwind Client#ExecuteQueryAsync](~/samples/snippets/csharp/VS_Snippets_Misc/astoria northwind client/cs/source.cs#executequeryasync)]
[!code-vb[Astoria Northwind Client#ExecuteQueryAsync](~/samples/snippets/visualbasic/VS_Snippets_Misc/astoria northwind client/vb/source.vb#executequeryasync)]
[!code-csharp[Astoria Northwind Client#ExecuteQueryAsync](~/samples/snippets/csharp/VS_Snippets_Misc/astoria_northwind_client/cs/source.cs#executequeryasync)]
[!code-vb[Astoria Northwind Client#ExecuteQueryAsync](~/samples/snippets/visualbasic/VS_Snippets_Misc/astoria_northwind_client/vb/source.vb#executequeryasync)]

]]></format>
</remarks>
Expand Down Expand Up @@ -1495,8 +1495,8 @@
## Examples
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.

[!code-csharp[Astoria Northwind Client#GetCustomersPaged](~/samples/snippets/csharp/VS_Snippets_Misc/astoria northwind client/cs/source.cs#getcustomerspaged)]
[!code-vb[Astoria Northwind Client#GetCustomersPaged](~/samples/snippets/visualbasic/VS_Snippets_Misc/astoria northwind client/vb/source.vb#getcustomerspaged)]
[!code-csharp[Astoria Northwind Client#GetCustomersPaged](~/samples/snippets/csharp/VS_Snippets_Misc/astoria_northwind_client/cs/source.cs#getcustomerspaged)]
[!code-vb[Astoria Northwind Client#GetCustomersPaged](~/samples/snippets/visualbasic/VS_Snippets_Misc/astoria_northwind_client/vb/source.vb#getcustomerspaged)]

]]></format>
</remarks>
Expand Down Expand Up @@ -1552,8 +1552,8 @@
## Examples
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)] .

[!code-csharp[Astoria Northwind Client#BatchQuery](~/samples/snippets/csharp/VS_Snippets_Misc/astoria northwind client/cs/source.cs#batchquery)]
[!code-vb[Astoria Northwind Client#BatchQuery](~/samples/snippets/visualbasic/VS_Snippets_Misc/astoria northwind client/vb/source.vb#batchquery)]
[!code-csharp[Astoria Northwind Client#BatchQuery](~/samples/snippets/csharp/VS_Snippets_Misc/astoria_northwind_client/cs/source.cs#batchquery)]
[!code-vb[Astoria Northwind Client#BatchQuery](~/samples/snippets/visualbasic/VS_Snippets_Misc/astoria_northwind_client/vb/source.vb#batchquery)]

]]></format>
</remarks>
Expand Down Expand Up @@ -2012,8 +2012,8 @@
## Examples
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)] .

[!code-csharp[Astoria Northwind Client#LoadRelatedOrderCustomer](~/samples/snippets/csharp/VS_Snippets_Misc/astoria northwind client/cs/source.cs#loadrelatedordercustomer)]
[!code-vb[Astoria Northwind Client#LoadRelatedOrderCustomer](~/samples/snippets/visualbasic/VS_Snippets_Misc/astoria northwind client/vb/source.vb#loadrelatedordercustomer)]
[!code-csharp[Astoria Northwind Client#LoadRelatedOrderCustomer](~/samples/snippets/csharp/VS_Snippets_Misc/astoria_northwind_client/cs/source.cs#loadrelatedordercustomer)]
[!code-vb[Astoria Northwind Client#LoadRelatedOrderCustomer](~/samples/snippets/visualbasic/VS_Snippets_Misc/astoria_northwind_client/vb/source.vb#loadrelatedordercustomer)]

]]></format>
</remarks>
Expand Down Expand Up @@ -2101,8 +2101,8 @@
## Examples
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.

[!code-csharp[Astoria Northwind Client#GetCustomersPagedNested](~/samples/snippets/csharp/VS_Snippets_Misc/astoria northwind client/cs/source.cs#getcustomerspagednested)]
[!code-vb[Astoria Northwind Client#GetCustomersPagedNested](~/samples/snippets/visualbasic/VS_Snippets_Misc/astoria northwind client/vb/source.vb#getcustomerspagednested)]
[!code-csharp[Astoria Northwind Client#GetCustomersPagedNested](~/samples/snippets/csharp/VS_Snippets_Misc/astoria_northwind_client/cs/source.cs#getcustomerspagednested)]
[!code-vb[Astoria Northwind Client#GetCustomersPagedNested](~/samples/snippets/visualbasic/VS_Snippets_Misc/astoria_northwind_client/vb/source.vb#getcustomerspagednested)]

]]></format>
</remarks>
Expand Down Expand Up @@ -2495,8 +2495,8 @@
## Examples
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.

[!code-csharp[Astoria Northwind Client#AddOrderDetailToOrder](~/samples/snippets/csharp/VS_Snippets_Misc/astoria northwind client/cs/source.cs#addorderdetailtoorder)]
[!code-vb[Astoria Northwind Client#AddOrderDetailToOrder](~/samples/snippets/visualbasic/VS_Snippets_Misc/astoria northwind client/vb/source.vb#addorderdetailtoorder)]
[!code-csharp[Astoria Northwind Client#AddOrderDetailToOrder](~/samples/snippets/csharp/VS_Snippets_Misc/astoria_northwind_client/cs/source.cs#addorderdetailtoorder)]
[!code-vb[Astoria Northwind Client#AddOrderDetailToOrder](~/samples/snippets/visualbasic/VS_Snippets_Misc/astoria_northwind_client/vb/source.vb#addorderdetailtoorder)]

]]></format>
</remarks>
Expand Down Expand Up @@ -2813,8 +2813,8 @@
## Examples
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)] .

[!code-csharp[Astoria Northwind Client#ModifyCustomer](~/samples/snippets/csharp/VS_Snippets_Misc/astoria northwind client/cs/source.cs#modifycustomer)]
[!code-vb[Astoria Northwind Client#ModifyCustomer](~/samples/snippets/visualbasic/VS_Snippets_Misc/astoria northwind client/vb/source.vb#modifycustomer)]
[!code-csharp[Astoria Northwind Client#ModifyCustomer](~/samples/snippets/csharp/VS_Snippets_Misc/astoria_northwind_client/cs/source.cs#modifycustomer)]
[!code-vb[Astoria Northwind Client#ModifyCustomer](~/samples/snippets/visualbasic/VS_Snippets_Misc/astoria_northwind_client/vb/source.vb#modifycustomer)]

]]></format>
</remarks>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,8 +27,8 @@
## Examples
This example uses a `do…while` loop to load `Customers` entities from a paged results from the data service.

[!code-csharp[Astoria Northwind Client#GetCustomersPaged](~/samples/snippets/csharp/VS_Snippets_Misc/astoria northwind client/cs/source.cs#getcustomerspaged)]
[!code-vb[Astoria Northwind Client#GetCustomersPaged](~/samples/snippets/visualbasic/VS_Snippets_Misc/astoria northwind client/vb/source.vb#getcustomerspaged)]
[!code-csharp[Astoria Northwind Client#GetCustomersPaged](~/samples/snippets/csharp/VS_Snippets_Misc/astoria_northwind_client/cs/source.cs#getcustomerspaged)]
[!code-vb[Astoria Northwind Client#GetCustomersPaged](~/samples/snippets/visualbasic/VS_Snippets_Misc/astoria_northwind_client/vb/source.vb#getcustomerspaged)]

]]></format>
</remarks>
Expand Down
12 changes: 6 additions & 6 deletions xml/System.Data.Services.Client/DataServiceQuery`1.xml
Original file line number Diff line number Diff line change
Expand Up @@ -86,13 +86,13 @@
## Examples
The following example shows a <xref:System.Data.Services.Client.DataServiceQuery%601> that is used with sequential <xref:System.Data.Services.Client.DataServiceQuery%601.AddQueryOption%2A> method calls to only return orders with a freight cost of more than $30 and to order the results by the ship date in descending order.

[!code-csharp[Astoria Northwind Client#AddQueryOptions](~/samples/snippets/csharp/VS_Snippets_Misc/astoria northwind client/cs/source.cs#addqueryoptions)]
[!code-vb[Astoria Northwind Client#AddQueryOptions](~/samples/snippets/visualbasic/VS_Snippets_Misc/astoria northwind client/vb/source.vb#addqueryoptions)]
[!code-csharp[Astoria Northwind Client#AddQueryOptions](~/samples/snippets/csharp/VS_Snippets_Misc/astoria_northwind_client/cs/source.cs#addqueryoptions)]
[!code-vb[Astoria Northwind Client#AddQueryOptions](~/samples/snippets/visualbasic/VS_Snippets_Misc/astoria_northwind_client/vb/source.vb#addqueryoptions)]

The following example shows how to compose a LINQ query that is equivalent to the previous query that used <xref:System.Data.Services.Client.DataServiceQuery%601.AddQueryOption%2A>.

[!code-csharp[Astoria Northwind Client#AddQueryOptionsLinq](~/samples/snippets/csharp/VS_Snippets_Misc/astoria northwind client/cs/source.cs#addqueryoptionslinq)]
[!code-vb[Astoria Northwind Client#AddQueryOptionsLinq](~/samples/snippets/visualbasic/VS_Snippets_Misc/astoria northwind client/vb/source.vb#addqueryoptionslinq)]
[!code-csharp[Astoria Northwind Client#AddQueryOptionsLinq](~/samples/snippets/csharp/VS_Snippets_Misc/astoria_northwind_client/cs/source.cs#addqueryoptionslinq)]
[!code-vb[Astoria Northwind Client#AddQueryOptionsLinq](~/samples/snippets/visualbasic/VS_Snippets_Misc/astoria_northwind_client/vb/source.vb#addqueryoptionslinq)]

]]></format>
</remarks>
Expand Down Expand Up @@ -344,8 +344,8 @@
## Examples
This example executes a query after it calls the <xref:System.Data.Services.Client.DataServiceQuery%601.IncludeTotalCount%2A> method. The <xref:System.Data.Services.Client.QueryOperationResponse%601.TotalCount%2A> property is used to determine number of entities returned by the query.

[!code-csharp[Astoria Northwind Client#CountAllCustomers](~/samples/snippets/csharp/VS_Snippets_Misc/astoria northwind client/cs/source.cs#countallcustomers)]
[!code-vb[Astoria Northwind Client#CountAllCustomers](~/samples/snippets/visualbasic/VS_Snippets_Misc/astoria northwind client/vb/source.vb#countallcustomers)]
[!code-csharp[Astoria Northwind Client#CountAllCustomers](~/samples/snippets/csharp/VS_Snippets_Misc/astoria_northwind_client/cs/source.cs#countallcustomers)]
[!code-vb[Astoria Northwind Client#CountAllCustomers](~/samples/snippets/visualbasic/VS_Snippets_Misc/astoria_northwind_client/vb/source.vb#countallcustomers)]

]]></format>
</remarks>
Expand Down
Loading