Share via


DomainService.Query Method

[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)

Syntax

'Declaration
Public Overridable Function Query ( _
    queryDescription As QueryDescription, _
    <OutAttribute> ByRef validationErrors As IEnumerable(Of ValidationResult), _
    <OutAttribute> ByRef totalCount As Integer _
) As IEnumerable
'Usage
Dim instance As DomainService
Dim queryDescription As QueryDescription
Dim validationErrors As IEnumerable(Of ValidationResult)
Dim totalCount As Integer
Dim returnValue As IEnumerable

returnValue = instance.Query(queryDescription, _
    validationErrors, totalCount)
public virtual IEnumerable Query(
    QueryDescription queryDescription,
    out IEnumerable<ValidationResult> validationErrors,
    out int totalCount
)
public:
virtual IEnumerable^ Query(
    QueryDescription^ queryDescription, 
    [OutAttribute] IEnumerable<ValidationResult^>^% validationErrors, 
    [OutAttribute] int% totalCount
)
abstract Query : 
        queryDescription:QueryDescription * 
        validationErrors:IEnumerable<ValidationResult> byref * 
        totalCount:int byref -> IEnumerable 
override Query : 
        queryDescription:QueryDescription * 
        validationErrors:IEnumerable<ValidationResult> byref * 
        totalCount:int byref -> IEnumerable 
public function Query(
    queryDescription : QueryDescription, 
    validationErrors : IEnumerable<ValidationResult>, 
    totalCount : int
) : IEnumerable

Parameters

  • totalCount
    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 nulla null reference (Nothing in Visual Basic) if there are no query results.

Remarks

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

See Also

Reference

DomainService Class

System.ServiceModel.DomainServices.Server Namespace