CSLA .NET

From Rockford Lhotka's Expert C# 2008 and VB 2008 Business Objects books

Welcome to CSLA .NET Sign in | Join | Help
in Search

Lists and MarkAsChild

Last post 01-01-2009, 11:12 AM by daniel_higgins. 1 replies.
Sort Posts: Previous Next
  •  01-01-2009, 8:34 AM 29434

    Lists and MarkAsChild

    Hi guys
    When adding BO's to a BO list i can't for the life of me find where it sets the items that are being added to the list as child objects (i.e. calling MarkAsChild). Does this mean you should manually call MarkAsChild before you put a BO in the list or am i missing something.

    The reason for asking is because BusinessListBase calls child.DeleteChild(); which intern checks to see if the child object being deleted is a child object. But i can't see where it is setting the BO's as children when adding them to the list. Hence it would seem that this should throw an exception all the time unless one manually calls MarkAsChild before adding a BO's to the list.

    Cheers
    Anthony

  •  01-01-2009, 11:12 AM 29437 in reply to 29434

    Re: Lists and MarkAsChild

    Hi Anthony,

    The BusinessListBase does not MarkAsChild.

    You need to construct your child objects as children.... that is, you need to use the Child_Fetch method (which will mark the object as a child), or call MarkAsChild explicity in your constructor (if you are not using the child dataportal stuff).

View as RSS news feed in XML

Please contact Magenic for your .NET consulting
and CSLA .NET mentoring needs.
Please consider making a donation to help support the ongoing development of CSLA .NET.

Make donation through PayPal - it's fast, free and secure!
Why donate?
Powered by Community Server, by Telligent Systems