R – NHibernate lazy loading property – what does build-time bytecode instrumentation mean

lazy-loadingnhibernate

I've tried to lazy-load a property in my domain model, but lazy loading doesn't work. (It is always loaded).

[Property(0, Column = "picture", Lazy=true)]
public virtual System.Byte[] Picture
{
       get { return picture; }
       set { picture = value; }
}

When reading the documentation here it says that it requires build-time bytecode instrumentation. What does this mean – and how can I get it ?

Best Answer

I have you tried a collection rather then an array?

[Property(0, Column = "picture", Lazy=true)]
public virtual IList<System.Byte> Picture
{
       get { return picture; }
       set { picture = value; }
}
Related Topic