Fluent NHibernate LazyLoad Issues

I couldn't find an answer to this issue so I assume it is something I am doing wrong.

I have a PersistenceModel set up where I have set a convention as follows: -

persistenceModel.Conventions.Add(DefaultLazy.Always());

However, for one of the HasManyToMany relationships in one of my entities I want eager loading to take place which I am setting up as follows: -

HasManyToMany(x => x.Affiliates).Not.LazyLoad();

Intuitively, I expect eager loading to take place as I am overriding the lazy load default that I have specified as a convention but it still lazy loads. If I set the DefaultLazy convention to never and then set LazyLoad on an individual relationship it doesn't work either.

Any ideas?

6
задан Dotnet 16 November 2010 в 17:07
поделиться