I'd like to use Example.Create() to query just by the unique values of an instance. To do so I need to find out the value of the unique-key property that had been set inside the mapping file, like this:
<property name="MyColumn">
<column name="MyColumn" unique-key="MyUniqueKeyGroup"/>
</property>
For better understanding - here is the important part of the code:
criteria.Add(Example.Create(myObject).SetPropertySelector(new MyPropertySelector()));
[...]
public class MyPropertySelector: NHibernate.Criterion.Example.IPropertySelector
{
#region IPropertySelector Member
public bool Include(object propertyValue, string propertyName, IType type)
{
/* here is where I want to check if the property belongs
* to the unique-key group 'MyUniqueKeyGroup' and return true if so
*/
}
#endregion
}
What do I need to do, to find out if a property belongs to the unique-key group 'MyUniqueKeyGroup'?