Event Wire Ups After Save (3.7.0)

Event Wire Ups After Save (3.7.0)

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


Brette.Net posted on Tuesday, August 11, 2009

Quick Question

I have a root and a child collection.

The root attaches to the ListChanged event of the child collection so it can run business rules upon the child list changing. This works great until I save the object. It seems that after the save the newly returned instance from the data portal does not 'rewire' the events.

Is this expected behavior? If so what is the best way to ensure the events get rewired?

Thanks,

Brette

RockfordLhotka replied on Tuesday, August 11, 2009

You do need to rehook any events after the object graph runs through the data portal. This is because event references aren't preserved by the .NET serializers.

Override OnDeserialized() in the root object to rehook the event(s).

Brette.Net replied on Tuesday, August 11, 2009

Much Appreciated Rocky!

Copyright (c) Marimer LLC