injectable
injectable copied to clipboard
Restricted generic type service registration
Say there is a service as such:
abstract class Repository<TEntity extends EntityDto> {
}
as for the implementation service:
class AppRepository<TEntity extends EntityDto> extends Repository<TEntity>{
}
This is how I am registering currently:
GetIt.I.registerFactory<Repository<Student>>(
() => AppRepository<Student>(),
);
Is it possible to decorate the Student class with a new decorator to include in the injectable build? Example:
@getItType
class EfPanel extends EntityDto {
}
Or any other solution will do.