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