event rewire after save

event rewire after save

Old forum URL: forums.lhotka.net/forums/t/7238.aspx


matt tag posted on Tuesday, July 07, 2009

I'm using Petar's original Observer class to communicate between CSLA objects (and sometimes the UI).  I have a CLSA class that subscribes to Observer.EventChannels.

It all works fine until I save the object - the saved clone no longer has the correct references to the observer class.

In my olden days, I thought there was an event I could override in my CSLA object that fired after the save object had come through the dataportal, so I could rehook events.  Does this still exist?

thanks,
matt tag

xAvailx replied on Tuesday, July 07, 2009

Could try "OnDeserialized", that may work...

RockfordLhotka replied on Tuesday, July 07, 2009

The method is OnDeserialized().

With a remote data portal that should work as you expect - you'll get notified on deserialization when the object graph hits the server, and again when the object graph rematerializes on the client.

With a local data portal, the serialization occurs before the save, not after, because the object graph is cloned and the cloned graph is saved, and if that succeeds it is returned to the caller without being re-serialized.

Marjon1 replied on Tuesday, July 07, 2009

I think the event you are referring to is OnDeserialized() which still exists!

Copyright (c) Marimer LLC