[WCF RIA Services Version 1 Service Pack 2 is compatible with either .NET framework 4 or .NET Framework 4.5, and with either Silverlight 4 or Silverlight 5.]
Represents a query method invocation.
Assembly: System.ServiceModel.DomainServices.Client (in System.ServiceModel.DomainServices.Client.dll)
Thetype exposes the following members.
|DomainClient||Gets the DomainClient for this query.|
|EntityType||Gets the type this query retrieves data from.|
|HasSideEffects||Gets a value indicating whether the query has side-effects.|
|IncludeTotalCount||Gets or sets a value indicating whether the TotalEntityCount property is required.|
|IsComposable||Gets a value indicating if the query supports composition.|
|Parameters||Gets the parameters required by the query method.|
|Query||Gets the underlying IQueryable for the query.|
|QueryName||Gets the name of the query method.|
In your client application, you can apply additional filtering on a query to limit which entities are returned. You use LINQ and a subset of LINQ query operators to modify the results returned from the query. The following lists the available query operators:
After you apply additional filtering, you pass the object as a parameter in the Load method to execute the query and get the results. If the query has a QueryAttribute with the IsComposable property set to false, you cannot apply additional filtering on the query. Generally, only queries that return a single entity will have IsComposable set to false.
The following code shows how to retrieve customers from the domain service. It filters customers who have phone numbers that start with 583 and orders them alphabetically by LastName. The results are displayed in a DataGrid.
Partial Public Class MainPage Inherits UserControl Private _customerContext As New CustomerDomainContext Public Sub New() InitializeComponent() Dim query As EntityQuery(Of Customer) query = _ From c In Me._customerContext.GetCustomersQuery() _ Where c.Phone.StartsWith("583") _ Order By c.LastName Dim loadOp = Me._customerContext.Load(query) CustomerGrid.ItemsSource = loadOp.Entities End Sub End Class