Ejemplo n.º 1
0
 public bool CNPJJaCadastrado(string cnpj, int id)
 {
     if (id > 0)
     {
         return(_service.GetAll().Any(c => c.CNPJ == cnpj && c.PessoaId != id));
     }
     else
     {
         return(_service.GetAll().Any(c => c.CNPJ == cnpj));
     }
 }
Ejemplo n.º 2
0
        public async Task <IActionResult> GetAll()
        {
            try
            {
                var result = await _pessoaJuridicaService.GetAll();

                if (result != null)
                {
                    return(new OkObjectResult(result));
                }

                return(NotFound());
            }
            catch (Exception ex)
            {
                throw new Exception(ex.Message);
            }
        }