DeepData (sample project) lists doubt...

DeepData (sample project) lists doubt...

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


elnoegarcia posted on Monday, October 15, 2007

Hello!!

A few days ago, I was searching the forum posts looking for samples or code snippets about how to load a grandchild object, so I found a link to the DeepData project sample that Rocky provides.

Now that I saw how he load some child objects with an interestig method, I've tried to implement that in one project I'm already working on. But when I was doing it, a new doubt raises: "Why the child (or children) objects aren't marked like children (with MarkAsChild()) on their constructor or in any other side?". I'm trying to implement that method in the normal way (ADO.NET directly), not using a DAL or DTO. Is it just for the fact that the children objects and list objects are ReadOnly?

Maybe someone can explain it to me (I hope).

Thanks in advance!

NoƩ

tmg4340 replied on Monday, October 15, 2007

Yes, that would be the reason.  MarkAsChild() has implications for saving/editing of objects.  Since ReadOnlyBase objects don't do any of that, MarkAsChild() isn't necessary/available.

If you were loading editable children/grandchildren, you would need to call MarkAsChild().

elnoegarcia replied on Tuesday, October 16, 2007

Ok thanks!! that's all I needed to know "tmg4340".

Have a nice day!Yes [Y]

Copyright (c) Marimer LLC