Advertisement
Ricarte

main

Jun 8th, 2023
968
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 0.80 KB | None | 0 0
  1. case 3:
  2.             Console.WriteLine("Qual o Id da pessoa a ter os dados atualizados? ");
  3.             int aux = Convert.ToInt32(Console.ReadLine()); // seleciona a pessoa pelo Id
  4.             Console.WriteLine("Insira os novos dados: ");
  5.             nome = Console.ReadLine() ?? throw new ArgumentNullException(nameof(nome));         // {
  6.             email = Console.ReadLine() ?? throw new ArgumentNullException(nameof(email));       // Lança a exception caso não seja dado valores as variaveis
  7.             telefone = Console.ReadLine() ?? throw new ArgumentNullException(nameof(telefone)); // }
  8.             Pessoa novosDados = new Pessoa(nome, email, telefone); // Instancia as novas informações
  9.             PessoaRepository.AtualizarPessoa(novosDados, aux); // Atualiza no banco de dados
  10.             break;
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement