I think the title says it all ... today when doing something like
async def handle_create_user(
command: CreateUserCommand, repository: BaseRepository[User]
):
the container is not able to return the concrete implementation of MongoRepositoryUser for instance. This is my binder:
from .models import AbstractModel
from .repository.base import BaseRepository
from .repository.databases.mongodb import MongoRepository
T = TypeVar("T", bound=AbstractModel) # Entity Type
# register all dependencies in inject
def bind_dependencies(binder):
binder.bind(BaseRepository[T], MongoRepository[T]())
Am I doing something wrong? Sorry if this is not the right channel for this kind of question or if this is not the right format to ask questions.