There was an errata in Rocky's site in version 1.x http://www.lhotka.net/Articles.aspx?id=3a47a231-1254-410c-babd-d9fc711ca58c you might what to check it.
In your property that holds the child list, I implemented this way,
If Me.IsNew() Then Return ChildList.NewChildList('') Else mChildList = ChildList.GetChildList(Me.ID) 'or mChildList = ChildList.GetChildList(Me) Return mChildList End If
Hi ajj30385,
Thanks for the correction.. I didn't noticed that one. ;-)
I hope jrnail23 can do the lazy loading now
Cheers,
Glenn
I tried lazy-loading in Csla (It's the same whether .Net 1.0 or 2.0), and found it frustrating in the very situations where you are most likely to use it, i.e., large hierarchies.
I do use it but selectively, being very deterministic about it. In other words, I try to be fully aware of what branch of a hierarchy can be loaded optionally and then program everything with that awareness, instead of just depending on If Not Null Then Load ...
Jav
If your doing in winforms, what I did in the CSLA 1.1 and VS.NET 2003 is to use BindingContext() to make it simplier to traverse from parent to child objects - grandchild objects.
I'm quite not sure if I got it right in the syntax its like this
Dim custContacts = Ctype(me.bindingcontext(mCustomers).Current, Customers).Contacts
The above line directs me to the current customer and gain access to Contacts (its child object)
Copyright (c) Marimer LLC