Backing field for collection is null when using LinFu ProxyFactoryFactory in NHibernate
问题 I am having a problem when I try switching from the Castle ProxyFactoryFactory to the LinFu ProxyFactoryFactory in NHibernate. I have an entity like this: public class Foo { private ISet<Bar> _bars = new HashedSet<Bar>(); public virtual void AddBar(Bar bar) { if (!_bars.Contains(bar) _bars.Add(bar); bar.Foo = this; } } This is mapped with Fluent NHibernate like this: public class FooDbMap : ClassMap<Foo> { public FooDbMap() { HasMany(x => x.Bars) .Access.CamelCaseField(Prefix.Underscore)