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
Copy file name to clipboardExpand all lines: docs/framework/data/wcf/configuring-the-data-service-wcf-data-services.md
+2-1Lines changed: 2 additions & 1 deletion
Original file line number
Diff line number
Diff line change
@@ -24,7 +24,8 @@ With [!INCLUDE[ssAstoria](../../../../includes/ssastoria-md.md)], you can create
24
24
25
25
The behaviors of the data service are defined by the members of the <xref:System.Data.Services.DataServiceConfiguration> class, and by members of the <xref:System.Data.Services.DataServiceBehavior> class, which is accessed from the <xref:System.Data.Services.DataServiceConfiguration.DataServiceBehavior%2A> property of the <xref:System.Data.Services.DataServiceConfiguration> class. The <xref:System.Data.Services.DataServiceConfiguration> class is supplied to the `InitializeService` method that is implemented by the data service, as in the following implementation of a Northwind data service:
Copy file name to clipboardExpand all lines: docs/framework/data/wcf/how-to-set-headers-in-the-client-request-wcf-data-services.md
+4-2Lines changed: 4 additions & 2 deletions
Original file line number
Diff line number
Diff line change
@@ -28,12 +28,14 @@ When you use the [!INCLUDE[ssAstoria](../../../../includes/ssastoria-md.md)] cli
28
28
> [!NOTE]
29
29
> When a data service requires you to manually set the message header for every request, consider registering the handler for the <xref:System.Data.Services.Client.DataServiceContext.SendingRequest> event by overriding the `OnContextCreated` partial method in the entity container that represents the data service, which in this case is `NorthwindEntities`.
The following method handles the <xref:System.Data.Services.Client.DataServiceContext.SendingRequest> event and adds an Authentication header to the request.
For more information, see [How to: Execute Data Service Queries](../../../../docs/framework/data/wcf/how-to-execute-data-service-queries-wcf-data-services.md).
@@ -51,7 +51,8 @@ The [!INCLUDE[ssAstoria](../../../../includes/ssastoria-md.md)] client library e
51
51
## LINQ Queries
52
52
Because the <xref:System.Data.Services.Client.DataServiceQuery%601> class implements the <xref:System.Linq.IQueryable%601> interface defined by LINQ, the [!INCLUDE[ssAstoria](../../../../includes/ssastoria-md.md)] client library is able to transform LINQ queries against entity set data into a URI that represents a query expression evaluated against a data service resource. The following example is a LINQ query that is equivalent to the previous <xref:System.Data.Services.Client.DataServiceQuery%601> that returns `Orders` that have a freight cost of more than $30 and orders the results by the freight cost:
This LINQ query is translated into the following query URI that is executed against the Northwind-based [quickstart](../../../../docs/framework/data/wcf/quickstart-wcf-data-services.md) data service:
Data service queries support all the query options that [!INCLUDE[ssAstoria](../../../../includes/ssastoria-md.md)]s provides. You call the <xref:System.Data.Services.Client.DataServiceQuery%601.AddQueryOption%2A> method to append query options to a <xref:System.Data.Services.Client.DataServiceQuery%601> instance. <xref:System.Data.Services.Client.DataServiceQuery%601.AddQueryOption%2A> returns a new <xref:System.Data.Services.Client.DataServiceQuery%601> instance that is equivalent to the original query but with the new query option set. The following query, when executed, returns `Orders` that are filtered by the `Freight` value and ordered by the `OrderID`, descending:
You can use the `$orderby` query option to both order and filter a query based on a single property, as in the following example that filters and orders the returned `Orders` objects based on the value of the `Freight` property:
The client executes a query in two parts. Whenever possible, expressions in a query are first evaluated on the client, and then a URI-based query is generated and sent to the data service for evaluation against data in the service. Consider the following LINQ query:
In this example, the expression `(basePrice – (basePrice * discount))` is evaluated on the client. Because of this, the actual query URI `http://localhost:12345/northwind.svc/Products()?$filter=(UnitPrice gt 90.00M) and substringof('bike',ProductName)` that is sent to the data service contains the already calculated decimal value of `90` in the filter clause. The other parts of the filtering expression, including the substring expression, are evaluated by the data service. Expressions that are evaluated on the client follow common language runtime (CLR) semantics, while expressions sent to the data service rely on the data service implementation of the [!INCLUDE[ssODataShort](../../../../includes/ssodatashort-md.md)] Protocol. You should also be aware of scenarios where this separate evaluation may cause unexpected results, such as when both the client and service perform time-based evaluations in different time zones.
Copy file name to clipboardExpand all lines: docs/framework/data/wcf/specify-client-creds-for-a-data-service-request-wcf.md
+6-4Lines changed: 6 additions & 4 deletions
Original file line number
Diff line number
Diff line change
@@ -25,22 +25,24 @@ By default, the client library does not supply credentials when sending a reques
25
25
## Example
26
26
The following example is from the code-behind page for an Extensible Application Markup Language (XAML) file that is the main page of the Windows Presentation Framework application. This example displays a `LoginWindow` instance to collect authentication credentials from the user, and then uses these credentials when making a request to the data service.
The following example is from the code-behind page for the window that is used to collect the authentication credentials from the user before making a request to the data service.
Copy file name to clipboardExpand all lines: docs/framework/wcf/extending/how-to-import-custom-policy-assertions.md
+1-1Lines changed: 1 addition & 1 deletion
Original file line number
Diff line number
Diff line change
@@ -49,7 +49,7 @@ Policy assertions describe the capabilities and requirements of a service endpoi
49
49
50
50
1. Add the importer type to the `<extensions>` element inside the [\<policyImporters>](../../../../docs/framework/configure-apps/file-schema/wcf/policyimporters.md) element in the client configuration file.
2. In the client application, use the <xref:System.ServiceModel.Description.MetadataResolver?displayProperty=fullName> or <xref:System.ServiceModel.Description.WsdlImporter?displayProperty=fullName> to resolve the metadata and the importer is invoked automatically.
[Configuring and Extending the Runtime with Behaviors](../../../../docs/framework/wcf/extending/configuring-and-extending-the-runtime-with-behaviors.md)
0 commit comments