[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.]
Specifies that a DomainService method is a query method.
Assembly: System.ServiceModel.DomainServices.Server (in System.ServiceModel.DomainServices.Server.dll)
Thetype exposes the following members.
|HasSideEffects||Gets or sets a value that indicates whether the query method has side effects.|
|IsComposable||Gets or sets a value that indicates whether the query method allows query composition.|
|IsDefault||Gets or sets a value indicating whether the query method should be treated as the default query when multiple query methods are available.|
|ResultLimit||Gets or sets the maximum number of results a query operation should return.|
|TypeId||(Inherited from Attribute.)|
|Equals||(Inherited from Attribute.)|
|Finalize||(Inherited from Object.)|
|GetHashCode||(Inherited from Attribute.)|
|GetType||(Inherited from Object.)|
|IsDefaultAttribute||(Inherited from Attribute.)|
|Match||(Inherited from Attribute.)|
|MemberwiseClone||(Inherited from Object.)|
|ToString||(Inherited from Object.)|
You apply the attribute to a method to indicate that the method is a query method, or to specify certain values for the query method. If your method matches the expected method signature for a query method, you do not have to apply the . The RIA Services framework will infer that a method with the expected query signature should be treated as a query. You apply the IgnoreAttribute to a method to prevent the RIA Services framework from generating a domain operation for that method.
The following shows the expected signature for a query method:
IEnumerable<T>, IQueryable<T>, or entity
<Query()> (Visual Basic)
public IQueryable<Product> GetProducts() (C#)
Public Function GetProducts() As IQueryable(Of Product) (Visual Basic)
The class enables you to set values that are used when processing the query request. You set the ResultLimit property to limit how many records are returned for a query. You may want to set this value to prevent a user from burdening the server with large query requests. For more information, see Building Secure Applications with WCF RIA Services. The IsComposable property enables you to specify whether code in the client project can modify the results of the query by using the query method within a new query. For example, when IsComposable is true, you can add a Where clause in client code to a query on the server that returns all of the records from a database table.