} //CheckCpfCnpjExistUpdate #endregion #region Remove... public Cliente Remove(Cliente cliente) { cliente = CheckIfReadyToRemove(cliente); if (cliente.ListaErros.Count != 0) { return(cliente); } _repositoryCliente.Remove(cliente); return(cliente); } //Remove
public void ExcluirCliente(int id) { Cliente c = _clienteRepository.GetById(id); if (c == null) { throw new ArgumentException("Cliente não encontrado"); } _clienteRepository.Remove(c); }