2009-09-11 17 views

risposta

20
Fluently.Configure() 
.Database(
     SQLiteConfiguration.Standard 
     .InMemory) 
     .Mappings(m => m.AutoMappings 
      .Add(AutoMap.AssemblyOf<_Field>())) 
     .Conventions 
      .Add(FluentNHibernate.Conventions.Helpers.DefaultLazy.Never()) 
     .BuildSessionFactory(); 
+3

A meno che non mi sbagli, ci sono 8 left-parens qui e 7 right-parens qui. – Ken

13

Si può provare con:

Not.LazyLoad(); 

all'interno del costruttore di mappatura.

+0

hai provato perché ho fatto ... e non funziona –

+0

ha funzionato per me. Volevo un oggetto di riferimento per essere caricato con l'oggetto e questo ha fatto. –

+0

Ha funzionato anche per noi. La nostra mappatura ha qualcosa del tipo: HasMany (e => e.Children) .KeyColumnNames.Add ("ParentId"). Cascade.AllDeleteOrphan(). Not.LazyLoad(); – Peter

5

Ti piace questa:

References(x => x.Something).Not.LazyLoad(); 
Problemi correlati