public Task <bool> Delete(AreaRequestDto requestDto)
        {
            ValidationDto(requestDto);

            var empleado = _empleadoRepositorio
                           .SearchMatching <EmpleadoEntity>(x => x.AreaId == requestDto.Id)
                           .Any();

            if (empleado)
            {
                throw new EmpleadoAreaAlreadyExistException(requestDto.NombreArea);
            }
            var entity = _mapper.Map <AreaEntity>(requestDto);

            return(_areaRepositorio.Delete(entity));
        }
        public Task <bool> DeleteArea(AreaDto request)
        {
            ValidationFields(request);
            var deleteArea = _areaRepo
                             .SearchMatching <AreaEntity>(d => d.AreaId == request.AreaId).FirstOrDefault();

            var employeeExist = _employeeRepo
                                .SearchMatching <EmployeeEntity>(e => e.AreaId == request.AreaId).Any();

            if (employeeExist)
            {
                throw new EmployeeExistInAreaException(request.AreaId);
            }

            var response = _areaRepo.Delete(_mapper.Map <AreaEntity>(deleteArea));

            return(Task.FromResult(response));
        }