Improved service providing

This commit is contained in:
Sven Heidemann 2020-12-20 14:49:28 +01:00
parent efc38731e7
commit e2715066a4

View File

@ -4,6 +4,7 @@ from typing import Type, Optional
from sh_edraft.configuration.base.configuration_model_base import ConfigurationModelBase from sh_edraft.configuration.base.configuration_model_base import ConfigurationModelBase
from sh_edraft.database.context.base.database_context_base import DatabaseContextBase from sh_edraft.database.context.base.database_context_base import DatabaseContextBase
from sh_edraft.environment.base import EnvironmentBase
from sh_edraft.hosting.base.application_runtime_base import ApplicationRuntimeBase from sh_edraft.hosting.base.application_runtime_base import ApplicationRuntimeBase
from sh_edraft.service.providing.base.service_provider_base import ServiceProviderBase from sh_edraft.service.providing.base.service_provider_base import ServiceProviderBase
from sh_edraft.service.base.service_base import ServiceBase from sh_edraft.service.base.service_base import ServiceBase
@ -31,6 +32,9 @@ class ServiceProvider(ServiceProviderBase):
if issubclass(parameter.annotation, ApplicationRuntimeBase): if issubclass(parameter.annotation, ApplicationRuntimeBase):
params.append(self._app_runtime) params.append(self._app_runtime)
elif issubclass(parameter.annotation, EnvironmentBase):
params.append(self._app_runtime.configuration.environment)
elif issubclass(parameter.annotation, DatabaseContextBase): elif issubclass(parameter.annotation, DatabaseContextBase):
params.append(self._database_context) params.append(self._database_context)