Fix bug in BaseEntityRepository and BaseService