public int InsertPerson(PersonDto data) { var newId = 1; if (_list.Count > 0) newId = _list.Max(_ => _.Id) + 1; data.Id = newId; _list.Add(data); return newId; }
public void UpdatePerson(PersonDto data) { var entity = GetPerson(data.Id); entity.FirstName = data.FirstName; entity.LastName = data.LastName; }