Generation

generate functionWed, 02 Aug 2023

tengo este servicio de crear public async Task<object> CrearAsync(MstReceptorBM model) { _repository.SetUser(model.Usuario); var apiResponse = new GenericResponse(); try { if (string.IsNullOrEmpty(model.SiglasPais)) { apiResponse.ErrorMessage = "Las siglas del Pais es obligatoria, favor validar"; apiResponse.OperationSuccess = false; return apiResponse; } if (!model.ValidarCreacion()) throw new ValidationException(message: "El registro no supera las validaciones, favor revisar los campos obligatorios"); pero aca valida que los campos del modelo no vengan vacios public static bool ValidarCreacion(this MstReceptorBM model) { if (model.IdTipoIdentificacion<=0) { return false; } if (string.IsNullOrEmpty(model.NumeroIdentificacion)) { return false; } if (string.IsNullOrEmpty(model.Nombre)) { return false; } if (string.IsNullOrEmpty(model.Apellido)) { return false; } if (string.IsNullOrEmpty(model.RazonSocial)) { return false; } if (string.IsNullOrEmpty(model.NombreComercial)) { return false; } if (string.IsNullOrEmpty(model.Direccion)) { return false; } if (string.IsNullOrEmpty(model.CorreoElectronico)) { return false; } if (model.IdPaisDomicilio<=0) { return false; } if (model.IdDepartamento<0) { return false; } if (model.IdCiudad<0) { return false; } return true; } ahora necesito que cuando se este creando un pero para el pais de guatemala me deje crearlo con los campos nombrecomercial vacio sin problema ayudame?

function that:

Questions about programming?Chat with your personal AI assistant