The EntitySpaces Community

Share and learn about the EntitySpaces Architecture.
Welcome to The EntitySpaces Community Sign in | Join | Help
in
Home Forums Photos

Does the IsDirty property bubble up child collection?

Last post 08-15-2008, 7:37 PM by srothman. 4 replies.
Sort Posts: Previous Next
  •  06-01-2007, 6:53 AM 2979

    Does the IsDirty property bubble up child collection?

    I currently have a screen that has a parent entity and several child collections. Now, when I make a change on the child collection, that collection's IsDirty property is set to true, but the parent Entity has its IsDirty flag set to false.

     Is there a method to determine if any of this data is dirty without checking each collection since they are all linked?

  •  06-02-2007, 4:50 PM 3004 in reply to 2979

    Re: Does the IsDirty property bubble up child collection?

    Sorry it took so long to get you an answer. The answer is no. IsDirty does not walk the hierarchical tree and report tree if something down the line is dirty. However, if this for trying to determine if you need to call save or not you can call Save() and if there are no dirty records then nothing will be sent to the database.

     


    EntitySpaces | Twitter | BLOG | Please honor our Software License
  •  08-15-2008, 1:47 PM 10764 in reply to 3004

    Re: Does the IsDirty property bubble up child collection?

    Is this the "correct" behavior for the IsDirty property?  Calling Save() is a perfectly reasonable thing to do since ES is smart about what gets sent to the database, but for me, I call IsDirty to give meaningful feedback to the user when they click a Cancel button on my forms.  If IsDirty returns False, I just close the form.  If it's True, I throw a MsgBox and ask if they're sure they want to discard their changes.  Ideally, the "parent" IsDirty property should be all that's necessary to check, no?
  •  08-15-2008, 5:24 PM 10767 in reply to 10764

    Re: Does the IsDirty property bubble up child collection?

    This thread and another are linked in our tracking system, so we know how many users are requesting this, but it is not in the current release.
    David Neal Parsons
    www.entityspaces.net
  •  08-15-2008, 7:37 PM 10768 in reply to 10767

    Re: Does the IsDirty property bubble up child collection?

    One follow-up question.  I'm going to attempt to do my own IsDirty check on the child collections but I'm having difficulty.  I'm not instantiating my child ES collection directly (i.e. it's using a BindingSource to which a grid control is bound to) so it's unclear how I should cast it back to an ES collection.

    My first attempt was to do this: 

     

    Code:
    CType(CustomerEquipmentProductCollectionByCustomerEquipmentIDBindingSource.DataSource, BusinessObjects.CustomerEquipmentProductCollection).IsDirty
    but the cast failed.  Any ideas what I'm doing wrong?

     

View as RSS news feed in XML