开发者

How to make Fluent NHibernate ignore Dictionary properties

I'm trying to make Fluent NHibernate's automapping ignore a Dictionary property on one of my classes, but Fluent is ignoring me instead. Ignoring other types of properties seems to work fine, but even after following the documentation and adding an override for the Dictionary, I still get the following exception when BuildSessionFactory is called:

The type or method has 2 generic parameter(s), but 1 generic argument(s) were provided. A generic argument must be provided for each generic parameter.

I've tried overriding by property name:

.Override<MyClass>(map => {
    map.IgnoreProperty(x => x.MyDictionaryProperty);
})

and also tried implementing ignores using a custom attribute, both of which result in the same exception from BuildSessionFactory. The only thing so far that makes this exception go away is removing the Dictionary property entirely.

My question seems to be identical to this one which was never answered (though I'll expand the scope by stating it doesn't ma开发者_Python百科tter whether the dictionary is on an abstract base class; the problem always happens for me regardless of what class the property is on). Any takers this time around?


If you update to the latest version of Fluent NHibernate, IDictionarys are explicitly ignored automatically for this exact reason. This will remain the case until we can actually support them.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜