Example #1
0
 public PersonV2 Add(PersonV2 person)
 {
     if (person == null)
     {
         throw new ArgumentNullException("person");
     }
     person.Id = fakeDatabaseId++;
     _people.Add(person);
     return(person);
 }
Example #2
0
        public bool Update(PersonV2 person)
        {
            if (person == null)
            {
                throw new ArgumentNullException("person");
            }
            int index = _people.FindIndex(p => p.Id == person.Id);

            if (index == -1)
            {
                return(false);
            }
            _people.RemoveAt(index);
            _people.Add(person);
            return(true);
        }