BMBM
BMBM

Reputation: 16013

nhibernate filter not working (unknown filter parameter)?

I have a filter like this:

<filter name="partnerIdFilter" condition="partner_id IN (:partnerId)"/>

and the partnerId parameter is defined like this:

<filter-def name="partnerIdFilter">    
    <filter-param name="partnerId" type="int[]"/>
</filter-def>

and the filter is enabled like this:

currentSession.EnableFilter("partnerIdFilter").SetParameterList("partnerId", specification.GetFilterValues());

But I get an NHibernate exception Undefined filter parameter [partnerId]

How can I fix this? Another filter in the same mapping file is working without any problems.

Upvotes: 2

Views: 1205

Answers (1)

Vadim
Vadim

Reputation: 17957

I know it's an old question, but I just learned the answer to this myself. The type has to be either a basic type or inherit from IType, ICompositeUserType, IUserType, ILIfecycle, an Enum or has to be Serializable. If it's none of those, then you get this rather cryptic error.

Upvotes: 2

Related Questions