Sorting and filtering data

In most applications, you'll want to give the user the ability to filter and/or sort the data they see on their screen. This recipe will show you one way of doing this: by using custom Query methods on your server project and accepting parameters to control the filtering/sorting you want to use.

Getting ready

This recipe uses the AdventureWorks Lite database—a free database you can download from http://www.codeplex.com/MSFTDBProdSamples. To follow this recipe, you need to have this database installed on an SQL Server instance you can access from your machine.

We're starting from the solution completed in the previous recipe. You can find a starter solution located in the Chapter09\Sorting_And_Filtering_Starter\ folder ...

Get Silverlight 4 Data and Services Cookbook now with O’Reilly online learning.

O’Reilly members experience live online training, plus books, videos, and digital content from 200+ publishers.