QueryAttribute.ResultLimit Property
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.]
Gets or sets the maximum number of results a query operation should return.
Namespace: System.ServiceModel.DomainServices.Server
Assembly: System.ServiceModel.DomainServices.Server (in System.ServiceModel.DomainServices.Server.dll)
The following example shows the ResultLimit applied to a query method that restricts the number of invoice records that can be returned by the query to 20.
In the following XAML, results are rendered based on the query for invoice records. Note that values for LoadSize and PageSize are both correctly set to a value less than that set in the ResultLimit applied to the query.
<Grid x:Name="LayoutRoot"> <ScrollViewer x:Name="PageScrollViewer" Style="{StaticResource PageScrollViewerStyle}"> <StackPanel x:Name="ContentStackPanel"> <TextBlock x:Name="HeaderText" Style="{StaticResource HeaderTextStyle}" Text="Invoices"/> <TextBlock x:Name="ContentText" Style="{StaticResource ContentTextStyle}" Text="Invoices - Simple View"/> <riaControls:DomainDataSource Name="domainDataSource1" AutoLoad="True" QueryName="GetInvoicesTablesQuery" LoadSize="10"> <riaControls:DomainDataSource.DomainContext> <ds:TestDomainContext></ds:TestDomainContext> </riaControls:DomainDataSource.DomainContext> <riaControls:DomainDataSource.SortDescriptors> <riaControls:SortDescriptor PropertyPath="InvoiceID" Direction="Ascending"></riaControls:SortDescriptor> <riaControls:SortDescriptor PropertyPath="Date" Direction="Ascending"></riaControls:SortDescriptor> </riaControls:DomainDataSource.SortDescriptors> </riaControls:DomainDataSource> <my:DataGrid ItemsSource="{Binding Data, ElementName=domainDataSource1}" /> <my:DataPager PageSize="10" Source="{Binding Data, ElementName=domainDataSource1}" /> </StackPanel> </ScrollViewer> </Grid>
Show: