예제 #1
0
        public async Task <List <PessoaFisicaResponseDto> > GetAllAsync()
        {
            var pessoas = await _repo.GetAllWithGenerosAsync();

            return(pessoas.Select(s => new PessoaFisicaResponseDto
            {
                Id = s.Id,
                Nome = s.Nome,
                Cpf = s.Cpf,
                DataNascimento = s.DataNascimento,
                Email = s.Email,
                Endereco = s.Endereco,
                Telefone = s.Telefone,
                GeneroId = s.GeneroId,
                Genero = new GeneroResponseDto {
                    Id = s.Genero.Id, Nome = s.Genero.Nome
                }
            }).ToList());
        }