public PersonV2 Add(PersonV2 person) { if (person == null) { throw new ArgumentNullException("person"); } person.Id = fakeDatabaseId++; _people.Add(person); return(person); }
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); }