I figured it out.  I didn't realize I could implement ILifecycle
directly.

Chris

On Dec 26, 3:22 pm, Chris Rock <[email protected]> wrote:
> Hi all.  Looking back (RC2ish), I guess ActiveRecordHooksBase used to
> implement ILifecycle.  Now that it doesn't, I'm not sure how to hook
> into the load of an object when it actually has the data.
>
> ARHooksBase:
>                 /// <summary>
>                 /// Hook to transform the read data
>                 /// from the database before populating
>                 /// the object instance
>                 /// </summary>
>                 /// <param name="id">id of the obejct</param>
>                 /// <param name="adapter">list of properties and their 
> values</
> param>
>                 /// <returns>Return <c>true</c> if you have changed the state.
> <c>false</c> otherwise</returns>
>                 protected virtual internal bool BeforeLoad(object id, 
> IDictionary
> adapter)
>                 {
>                         OnLoad(id);
>
>                         return false;
>                 }
>
>                 /// <summary>
>                 /// Lifecycle method invoked during Load of the entity
>                 /// </summary>
>                 protected virtual void OnLoad(object id)
>                 {
>                 }
>
> Previously, Onliad(object id) was called from ILifeCycle.Onload, which
> happens _after_ the object has its properties set, now it's called
> from BeforeLoad.
>
> If you override OnLoad(object id) you can't get to the data from
> anywhere that I can see.  I need to set some transient "Confirm"
> properties from their persistent siblings for UI binding and
> validation.  I'm sure I'm just missing something.  Any thoughts
> appreciated.
>
> Regards,
> Chris

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"Castle Project Users" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to 
[email protected]
For more options, visit this group at 
http://groups.google.com/group/castle-project-users?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to