Apply a filter to a persistent collection, binding the given parameters to "?" placeholders.

Namespace:  NHibernate
Assembly:  NHibernate (in NHibernate.dll)

Syntax

Visual Basic (Declaration)
<ObsoleteAttribute("Use ISession.CreateFilter().SetXYZ().List()")> _
Function Filter ( _
	collection As Object, _
	filter As String, _
	values As Object(), _
	types As IType() _
) As ICollection
C#
[ObsoleteAttribute("Use ISession.CreateFilter().SetXYZ().List()")]
ICollection Filter(
	Object collection,
	string filter,
	Object[] values,
	IType[] types
)
Visual C++
[ObsoleteAttribute(L"Use ISession.CreateFilter().SetXYZ().List()")]
ICollection^ Filter(
	Object^ collection, 
	String^ filter, 
	array<Object^>^ values, 
	array<IType^>^ types
)
JavaScript
function filter(collection, filter, values, types);

Parameters

collection
Type: System..::.Object
A persistent collection to filter
filter
Type: System..::.String
A filter query string
values
Type: array< System..::.Object >[]()[]
The values to be written to "?" placeholders in the query
types
Type: array< NHibernate.Type..::.IType >[]()[]
The hibernate types of the values

Return Value

A collection

Remarks

A filter is a Hibernate query that may refer to this, the collection element. Filters allow efficient access to very large lazy collections. (Executing the filter does not initialize the collection.)

See Also