コード例 #1
0
        public void DeletePerson(Person newPerson)
        {
            if (!_personDictionary.ContainsKey(newPerson.Id))
                throw new FaultException<PersonNotFound>( new PersonNotFound());

            _personDictionary.Remove(newPerson.Id);
        }
コード例 #2
0
        public void UpdatePerson(Person newPerson)
        {
            if (!_personDictionary.ContainsKey(newPerson.Id))
                throw new FaultException<PersonNotFound>(new PersonNotFound());

            _personDictionary[newPerson.Id].PhoneNumber = newPerson.PhoneNumber;
        }
コード例 #3
0
 public Int32 AddPerson(Person newPerson)
 {
     var id = _personDictionary.Keys.Max() + 1;
     newPerson.Id = id;
     _personDictionary.Add(id, newPerson);
     return id;
 }