11

how to disable lazy loading in fn r1.0?

Mauricio Scheffer
  • 98,863
  • 23
  • 192
  • 275
Chen Kinnrot
  • 20,609
  • 17
  • 79
  • 141

3 Answers3

21
Fluently.Configure()
.Database(
       SQLiteConfiguration.Standard
       .InMemory)
       .Mappings( m => m.AutoMappings
           .Add( AutoMap.AssemblyOf<_Field>() ) )
       .Conventions
           .Add( FluentNHibernate.Conventions.Helpers.DefaultLazy.Never() )
       .BuildSessionFactory();
Sergei Tachenov
  • 24,345
  • 8
  • 57
  • 73
Aaron Fischer
  • 20,853
  • 18
  • 75
  • 116
15

You can try with:

Not.LazyLoad();

inside your mapping constructor.

Darin Dimitrov
  • 1,023,142
  • 271
  • 3,287
  • 2,928
  • it worked for me. I wanted an object reference to be loaded with the object and this did it. – James Jones Nov 04 '09 at 21:24
  • It worked for us also. Our mapping has something like: HasMany(e => e.Children).KeyColumnNames.Add("ParentId").Cascade.AllDeleteOrphan().Not.LazyLoad(); – Peter Nov 19 '09 at 10:14
5

Like this:

References(x => x.Something).Not.LazyLoad();
l3dx
  • 2,930
  • 6
  • 33
  • 43