How to: Filter Data in a LightSwitch Application by Using Code
By using the <EntitySet>_Filter query method, you can display a subset of records for each user based on permissions. For example, you might want to allow each employee to display only their salary information.
To apply a filter
In Solution Explorer, open the shortcut menu for the entity or table to which you want to apply a filter, and then choose Open.
The entity or table opens in the Data Designer.
For applications that have been upgraded to Visual Studio 2012 Update 2, on the Perspective bar, choose the Server tab.
On the command bar in the Data Designer, in the Write Code list, choose EntitySet_Filter.
In the Code Editor, add code to the method.
The following code example filters the Employees entity so that the current user can display only the records that contain their Employee Name: