예제 #1
0
        public ICommandResult Handler(ComandoInserirPessoa command)
        {
            command.Validate();
            if (command.Invalid)
            {
                //return new CommandResult(false,"Não foi possível cadastrar está pessoa");
            }

            if (_repositorio.ExisteCpf(command.Cpf))
            {
                AddNotification("Cpf", "Este CPF já foi cadastrado");
            }

            var nome   = new Nome(command.PrimeiroNome, command.SegundoNome);
            var cpf    = new Documento(command.Cpf, ETipoDocumento.CPF);
            var rg     = new Documento(command.Cpf, ETipoDocumento.RG);
            var pessoa = new Pessoa(nome, cpf, rg, command.Sexo, command.DataNascimento);

            throw new System.NotImplementedException();
        }