Issue with child object and isNew property?

Issue with child object and isNew property?

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


reagan123 posted on Friday, February 27, 2009

I have an object that has a child collection.  I assign a child to my object and hit save and everything is fine.

I then remove the existing child and add a new child to the object and click save... this is where my problem occurs.  When saving the child collection it finds one object in the DeletedList.  This one object goes to DeleteSelf, but it is still flagged as IsNew even though it has been persisted to the database already so it exits the procedure.

I can get around this by immediately re-fetching the object after the initial save, but I don't think this is the correct approach.

Does anyone know what I may be missing?

Thanks!



rob.polak replied on Friday, February 27, 2009

Are you using MarkOld() after the insert/update?

reagan123 replied on Friday, February 27, 2009

That did it...

Thanks!

Copyright (c) Marimer LLC