getRepository method
Get the repository or throw if not initialized
Implementation
@protected
R getRepository() {
if (_repository == null) {
throw StateError(
"Repository not initialized. Call initRepository first.");
}
return _repository;
}