public List <DepartamentoDto> GetDapartamentos() { var depts = _departamentoRepository.GetDepartametos(); var deptsDto = new List <DepartamentoDto>(); foreach (var dept in depts) { deptsDto.Add(_mapper.Map <DepartamentoDto>(dept)); } return(deptsDto); }