Visual Basic (Declaration) | |
---|---|
Public Class EntityQueryFilterCollection |
Visual Basic (Usage) | ![]() |
---|---|
Dim instance As EntityQueryFilterCollection |
C# | |
---|---|
public class EntityQueryFilterCollection |
C++/CLI | |
---|---|
public ref class EntityQueryFilterCollection |
C# | ![]() |
---|---|
public void FilteringSample() { // Query for all customers. A filter will be applied prior to execution. var mgr = new DomainModelEntityManager(); var list = mgr.Customers.ToList(); } // Server-side implementation of EntityServerQueryInterceptor public class EntityServerQueryManager : EntityServerQueryInterceptor { protected override bool FilterQuery() // Add filters QueryFilters.AddFilter<Customer>(q => q.Where(c => c.Country == "USA")); QueryFilters.AddFilter<Employee>(q => q.Where(e => e.Country == "USA")); return true; } } |
Use the EntityQueryFilterCollection to create a collection of filters for different entity types. You can create the collection independent of your queries and apply the filters when needed, for example in a server-side EntityServerQueryInterceptor implementation using the Filter extension method.
The collection may contain only one query filter per entity type, but may contain any number of filters. When applied to an EntityQuery, only the applicable filters will be used. For example, if you'ved added filters for both the Customer and Employee entity types to a collection and apply this to a query of Customers, only the pertinent filter will be applied.
System.Object
IdeaBlade.EntityModel.EntityQueryFilterCollection
Target Platforms: Windows 98, Windows NT 4.0, Windows Millennium Edition, Windows 2000, Windows XP Home Edition, Windows XP Professional, Windows Server 2003 family, Windows Vista, Windows Server 2008 family