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();