I have the same problem as ronaldvd.
Every object created by the lazy loading mechanism is of the correct type except 1 here and there. It seems to always be the same one.
Here is a snippet of the code that I use to Lazy load a collection in a persistant class:
Code:
public virtual void LazyInitCollection(System.Collections.IEnumerable Collection, Framework.Objects.FrameworkObject parent)
{
this.Session.Lock(parent, NHibernate.LockMode.None);
//iterate over the collection in order for lazy loading to work
foreach (Framework.Objects.FrameworkObject obj in Collection)
{
obj.SetSession(this);
obj.SetRoot(parent.GetRoot());
}
}
Please if someone found a solution I would very much appreciate any tips or help.
Thanks