public ListPeople Add(ListPeople listPeople) { if (listPeople == null) { throw new ArgumentNullException("listpeople"); } listPeople.Name = newname; people.Add(listPeople); return(listPeople); }
public bool Update(ListPeople listPeople) { if (listPeople == null) { throw new ArgumentNullException("listpeople"); } int index = people.FindIndex(b => b.Name == listPeople.Name); if (index == -1) { return(false); } people.RemoveAt(index); people.Add(listPeople); return(true); }