public Person UpdatePerson(string id, Person updatePerson) { Person p = persons.FirstOrDefault(e => e.ID.Equals(id)); p.Name = updatePerson.Name; p.Age = updatePerson.Age; return p; }
public Person CreatePerson(Person createPerson) { createPerson.ID = (++personCount).ToString(); persons.Add(createPerson); return createPerson; }