Ejemplo n.º 1
0
        public void AddAdult(Adult adult, Family family)
        {
            int currentFamily = Families.IndexOf(family);


            int max = Adults.Max(adult => adult.Id);

            adult.Id = (++max);

            Families.ElementAt(currentFamily).Adults.Add(adult);
            Adults.Add(adult);
            SaveChanges();
        }