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); }
public ClienteDTO GetById(string id) { return(mapper.Map <ClienteDTO>(ClienteDomainService.GetById(Guid.Parse(id)))); }