DomainService.Query Method

WCF RIA Services

[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.]

Performs the query operation indicated by the specified QueryDescription.

Namespace:  System.ServiceModel.DomainServices.Server
Assembly:  System.ServiceModel.DomainServices.Server (in System.ServiceModel.DomainServices.Server.dll)

public virtual IEnumerable Query(
	QueryDescription queryDescription,
	out IEnumerable<ValidationResult> validationErrors,
	out int totalCount


Type: System.ServiceModel.DomainServices.Server.QueryDescription
The description of the query to perform.
Type: System.Collections.Generic.IEnumerable<ValidationResult>%
When this method returns, contains a collection of validation errors. This parameter will be null if no validation errors are encountered.
Type: System.Int32%
When this method returns, contains the total number of rows based on the specified query, without any paging applied to it.

Return Value

Type: System.Collections.IEnumerable
The query results, or null if there are no query results.

If the query returns a singleton, it is returned as an IEnumerable that contains the single result.