IdeaBlade DevForce 2010 Help Reference
EntityQueryFilterCollection Class
Members  Example  See Also  Send Feedback
IdeaBlade.EntityModel Assembly > IdeaBlade.EntityModel Namespace : EntityQueryFilterCollection Class



An independent collection of query filters.

Syntax

Visual Basic (Declaration) 
Public Class EntityQueryFilterCollection 
Visual Basic (Usage)Copy Code
Dim instance As EntityQueryFilterCollection
C# 
public class EntityQueryFilterCollection 
C++/CLI 
public ref class EntityQueryFilterCollection 

Example

C#Copy Code
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;
	}
}

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.

Inheritance Hierarchy

System.Object
   IdeaBlade.EntityModel.EntityQueryFilterCollection

Requirements

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

See Also

© 2013 All Rights Reserved.