Support for Query By Example.

Namespace: NHibernate.Criterion
Assembly: NHibernate (in NHibernate.dll) Version: 3.2.0.4000 (3.2.0.4000)

Syntax

C#
[SerializableAttribute]
public class Example : AbstractCriterion
Visual Basic
<SerializableAttribute> _
Public Class Example _
	Inherits AbstractCriterion
Visual C++
[SerializableAttribute]
public ref class Example : public AbstractCriterion

Remarks

"Examples" may be mixed and matched with "Expressions" in the same ICriteria

Examples

CopyC#
List results = session.CreateCriteria(typeof(Parent))
.Add( Example.Create(parent).IgnoreCase() )
.CreateCriteria("child")
.Add( Example.Create( parent.Child ) )
.List();

Inheritance Hierarchy

System..::..Object
  NHibernate.Criterion..::..AbstractCriterion
    NHibernate.Criterion..::..Example

See Also