Added automatic key detection for EFRepository.