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