public Eleve Add(Eleve item) { if (item == null) { throw new ArgumentNullException("item"); } item.Id = _nextId++; eleves.Add(item); return(item); }
public bool Update(Eleve item) { if (item == null) { throw new ArgumentNullException("item"); } int index = eleves.FindIndex(p => p.Id == item.Id); if (index == -1) { return(false); } eleves.RemoveAt(index); eleves.Add(item); return(true); }