Exemplo n.º 1
0
 public void addChild(Child child)
 {
     if (DataSource.childList.Exists(c => c.idChild == child.idChild))//no child found
     {
         throw new Exception("Child is already exist in system");
     }
     DataSource.childList.Add(child.duplicate());
 }
Exemplo n.º 2
0
        public void updateChild(Child child)
        {
            int index = DataSource.childList.FindIndex(c => c.idChild == child.idChild);

            if (index == -1)//no child found
            {
                throw new Exception("Child is not appear in system");
            }
            DataSource.childList[index] = child.duplicate();
        }