Пример #1
0
        /// <summary>
        /// 
        /// </summary>
        /// <param name="contact"></param>
        public void add(contact contact)
        {
            if (!_contacts.Contains(contact))
            {
                _contacts.Add(contact);
            }
            else
            {
                var existing = _contacts.Single(c => c.id.Equals(contact.id));

                if(existing!=null)
                {
                    existing.name = contact.name;
                    existing.lastname = contact.lastname;
                    existing.bio = contact.bio;
                    existing.dateofbirth = contact.dateofbirth;
                }

            }
        }
Пример #2
0
 /// <summary>
 /// 
 /// </summary>
 /// <param name="aggregate"></param>
 public void remove(contact aggregate)
 {
     _contacts.Remove(aggregate);
 }
Пример #3
0
 //
 public void remove(contact contact)
 {
     _repository.remove(contact);
 }
Пример #4
0
 /// <summary>
 /// 
 /// </summasiry>
 /// <param name="contact"></param>
 public void create(contact contact)
 {
     _repository.add(contact);
 }