Controller.Repositorio.ClienteRepositorio.Deletar C# (CSharp) Method

Deletar() public method

public Deletar ( Cliente cliente ) : int
cliente Model.Entidades.Cliente
return int
        public int Deletar(Cliente cliente)
        {
            try
            {
                _banco.Entry(cliente).State = EntityState.Deleted;
                return _banco.SaveChanges() == Sucesso ? Sucesso : Sucesso;

            }
            catch (CustomException erro)
            {
                throw new CustomException(erro.Message);
            }
            catch (Exception erro)
            {
                throw new Exception(erro.Message);
            }
        }