Пример #1
0
        /// <summary>
        /// If the relationship is <see cref="IBusinessObject.MarkForDelete"/>.DeleteRelated then
        /// all the related objects and their relevant children will be marked for Delete.
        /// See <see cref="IRelationship.DeleteParentAction"/>
        /// </summary>
        public override void MarkForDelete()
        {
            if (this.RelationshipDef.DeleteParentAction != DeleteParentAction.DeleteRelated)
            {
                return;
            }
            IBusinessObjectCollection collection = this.BusinessObjectCollection;

            collection.Refresh();
            for (var i = collection.Count - 1; i >= 0; i--)
            {
                collection[i].MarkForDelete();
            }
        }