Exemplo n.º 1
0
        public async Task <ClienteDto> AdquirirCliente(long id)
        {
            var clienteEntity = await _clienteDomainService.GetById(id);

            var retorno = _mapper.Map <ClienteDto>(clienteEntity);

            return(retorno);
        }
        public ClienteDTO Update(ClienteEdicaoModel model)
        {
            var aluno = _clienteDomainService.GetById(model.IdCliente);

            if (aluno == null)
            {
                throw new Exception("Aluno não encontrado");
            }

            aluno.Nome           = model.Nome;
            aluno.DataNascimento = model.DataDeNascimento;
            aluno.Email          = model.Email;

            _clienteDomainService.Update(aluno);

            var alunoModel = _mapper.Map <ClienteDTO>(aluno);

            return(alunoModel);
        }
        public void Delete(int id)
        {
            var cliente = clienteDomainService.GetById(id);

            clienteDomainService.Delete(cliente);
        }
Exemplo n.º 4
0
 public ClienteDTO GetById(string id)
 {
     return(mapper.Map <ClienteDTO>(ClienteDomainService.GetById(Guid.Parse(id))));
 }