how to disable lazy loading in fn r1.0?
Asked
Active
Viewed 9,385 times
3 Answers
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
-
3Unless I'm mistaken, there's 8 left-parens here, and 7 right-parens here. – Ken Oct 06 '11 at 00:53
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