DevForce Help Reference
EntityQueryFilterCollection Class
Members  Example 


An independent collection of query filters.
Syntax
'Declaration
 
Public Class EntityQueryFilterCollection 
'Usage
 
Dim instance As EntityQueryFilterCollection
public class EntityQueryFilterCollection 
Remarks
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.

Example
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;
	}
}
Inheritance Hierarchy

System.Object
   IdeaBlade.EntityModel.EntityQueryFilterCollection

Requirements

Target Platforms: Windows 7, Windows Vista SP1 or later, Windows XP SP3, Windows Server 2008 (Server Core not supported), Windows Server 2008 R2 (Server Core supported with SP1 or later), Windows Server 2003 SP2

See Also

Reference

EntityQueryFilterCollection Members
IdeaBlade.EntityModel Namespace

Send Feedback