Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

fluent nhibernate r1.0 fluent mapping disable lazy load

how to disable lazy loading in fn r1.0?

like image 817
Chen Kinnrot Avatar asked Sep 11 '09 16:09

Chen Kinnrot


3 Answers

Fluently.Configure()
.Database(
       SQLiteConfiguration.Standard
       .InMemory)
       .Mappings( m => m.AutoMappings
           .Add( AutoMap.AssemblyOf<_Field>() ) )
       .Conventions
           .Add( FluentNHibernate.Conventions.Helpers.DefaultLazy.Never() )
       .BuildSessionFactory();
like image 130
Aaron Fischer Avatar answered Oct 24 '22 21:10

Aaron Fischer


You can try with:

Not.LazyLoad();

inside your mapping constructor.

like image 37
Darin Dimitrov Avatar answered Oct 24 '22 20:10

Darin Dimitrov


Like this:

References(x => x.Something).Not.LazyLoad();
like image 39
l3dx Avatar answered Oct 24 '22 20:10

l3dx