fluent nhibernate r1.0 fluent mapping disable lazy load

僤鯓⒐⒋嵵緔 提交于 2019-12-04 08:47:40

问题


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

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!