From e2715066a44684b392acc69629dec69936ebaaec Mon Sep 17 00:00:00 2001 From: Sven Heidemann Date: Sun, 20 Dec 2020 14:49:28 +0100 Subject: [PATCH] Improved service providing --- src/sh_edraft/service/providing/service_provider.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/sh_edraft/service/providing/service_provider.py b/src/sh_edraft/service/providing/service_provider.py index b4defc4b..6cec42a4 100644 --- a/src/sh_edraft/service/providing/service_provider.py +++ b/src/sh_edraft/service/providing/service_provider.py @@ -4,6 +4,7 @@ from typing import Type, Optional from sh_edraft.configuration.base.configuration_model_base import ConfigurationModelBase 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.service.providing.base.service_provider_base import ServiceProviderBase from sh_edraft.service.base.service_base import ServiceBase @@ -31,6 +32,9 @@ class ServiceProvider(ServiceProviderBase): if issubclass(parameter.annotation, ApplicationRuntimeBase): params.append(self._app_runtime) + elif issubclass(parameter.annotation, EnvironmentBase): + params.append(self._app_runtime.configuration.environment) + elif issubclass(parameter.annotation, DatabaseContextBase): params.append(self._database_context)