예제 #1
0
 public Person UpdatePerson(string id, Person person)
 {
     long personId;
     if (long.TryParse(id, out personId))
     {
         return personRepository.UpdatePerson(personId, person);
     }
     return null;
 }
예제 #2
0
 public Person UpdatePerson(long id, Person person)
 {
     var personToUpdate = persons.FirstOrDefault(p => p.Id == id);
     if (person != null)
     {
         personToUpdate = person;
         return personToUpdate;
     }
     return null;
 }
예제 #3
0
 public Person AddPerson(Person person)
 {
     person.Id = GetNewId();
     persons.Add(person);
     return person;
 }
예제 #4
0
 public Person InsertPerson(Person person)
 {
     return personRepository.AddPerson(person);
 }