It seems I can't find the correct syntax to define a nhibernate filter using fluent Nhibernate.
I'm trying to follow this ayende's blogpost:
http://ayende.com/Blog/archive/2006/12/26/LocalizingNHibernateContextualParameters.aspx
I defined the formula on my property with .FormulaIs() method but can't find on google how to translate this definition to fluent nhibernate:
< filter-def name='CultureFilter'>
< filter-param name='CultureId' type='System.Int32'/>
< /filter-def>
Best Answer
If you build Fluent from source, there is now support for filters. You use them like this:
First create a class inheriting from
FluentNHibernate.Mapping.FilterDefinition
:In your ClassMap for your class, use the ApplyFilter method:
Then add the filter to your fluent config:
Then you can turn it on and off just as you would with vanilla NHibernate: