public async Task <ClienteModel> IncluirClienteAsync(string nome) { if (!ClienteModel.NomeClienteaValido(nome)) { throw new Exception("O Parâmetro nome é inválido."); } nome = ClienteModel.LimitarTamanhoNomeCliente(nome); if (await _clienteRepositorio.ClientJaCadastradoAsync(nome)) { throw new Exception("Este Cliente já está cadastrado."); } int id = await _clienteRepositorio.IncluirClienteAsync(nome); return(new ClienteModel { Id = id, Nome = nome }); }