问题
how to disable lazy loading in fn r1.0?
回答1:
Fluently.Configure()
.Database(
SQLiteConfiguration.Standard
.InMemory)
.Mappings( m => m.AutoMappings
.Add( AutoMap.AssemblyOf<_Field>() ) )
.Conventions
.Add( FluentNHibernate.Conventions.Helpers.DefaultLazy.Never() )
.BuildSessionFactory();
回答2:
You can try with:
Not.LazyLoad();
inside your mapping constructor.
回答3:
Like this:
References(x => x.Something).Not.LazyLoad();
来源:https://stackoverflow.com/questions/1412002/fluent-nhibernate-r1-0-fluent-mapping-disable-lazy-load