Exemple #1
0
 public void MarkChildForDeletion(DTOVersionObject child)
 {
     if (Changes.FirstOrDefault(c => c.Object == child && c.ChangeType == ChangeType.ChildDelete) == null)
     {
         Changes.Add(new ChangeItem(child, ChangeType.ChildDelete));
         Changes.RemoveAll(c => c.Object == child && c.ChangeType != ChangeType.ChildDelete);
     }
 }
Exemple #2
0
        public void MarkChildForUpdate(DTOVersionObject child)
        {
            //if (Changes.FirstOrDefault(c => c.Object == child && (c.ChangeType == ChangeType.ChildUpate || c.ChangeType == ChangeType.ChildInsert)) == null)
            ChangeItem oldObject = Changes.FirstOrDefault(c => c.Object.Id == child.Id && (c.ChangeType == ChangeType.ChildUpate || c.ChangeType == ChangeType.ChildInsert));

            if (oldObject != null)
            {
                Changes.Remove(oldObject);
            }
            Changes.Add(new ChangeItem(child, ChangeType.ChildUpate));
        }
Exemple #3
0
 public ChangeItem(DTOVersionObject obj, ChangeType type)
 {
     this.Object = obj;
     this.ChangeType = type;
 }