From a0e77586d9d9365157dde5f407b15f97e9c3b0e5 Mon Sep 17 00:00:00 2001 From: Bruno Date: Sat, 2 Nov 2024 01:45:47 -0300 Subject: [PATCH] fix --- OpenAdm.Application/Dtos/Usuarios/CreateUsuarioDto.cs | 6 +++--- OpenAdm.Infra/Context/ParceiroContext.cs | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/OpenAdm.Application/Dtos/Usuarios/CreateUsuarioDto.cs b/OpenAdm.Application/Dtos/Usuarios/CreateUsuarioDto.cs index f8506d9..3e486f4 100644 --- a/OpenAdm.Application/Dtos/Usuarios/CreateUsuarioDto.cs +++ b/OpenAdm.Application/Dtos/Usuarios/CreateUsuarioDto.cs @@ -45,7 +45,7 @@ public void Validar() throw new ExceptionApi("As senha não conferem!"); } - if(!string.IsNullOrWhiteSpace(Cpf) && !ValidarCnpjECpf.IsCpf(Cpf)) + if (!string.IsNullOrWhiteSpace(Cpf) && !ValidarCnpjECpf.IsCpf(Cpf)) { throw new ExceptionApi("CPF inválido!"); } @@ -71,8 +71,8 @@ public Usuario ToEntity() senha, Nome, Telefone, - Cnpj, - Cpf, + string.IsNullOrWhiteSpace(Cnpj) ? null : Cnpj, + string.IsNullOrWhiteSpace(Cpf) ? null : Cpf, true); } } diff --git a/OpenAdm.Infra/Context/ParceiroContext.cs b/OpenAdm.Infra/Context/ParceiroContext.cs index 12e2494..6d9357c 100644 --- a/OpenAdm.Infra/Context/ParceiroContext.cs +++ b/OpenAdm.Infra/Context/ParceiroContext.cs @@ -38,7 +38,7 @@ public class ParceiroContext(DbContextOptions options, IParceiroAutenticado parc protected override void OnConfiguring(DbContextOptionsBuilder optionsBuilder) { optionsBuilder.UseNpgsql(_parceiroAutenticado.StringConnection); - //optionsBuilder.UseNpgsql("User ID=postgres; Password=1234; Host=localhost; Port=4449; Database=open-adm-cliente; Pooling=true;"); + //optionsBuilder.UseNpgsql(""); base.OnConfiguring(optionsBuilder); }