2021.4.2 #12

Merged
edraft merged 22 commits from 2021.4.2 into 2021.4 2021-03-29 15:48:59 +02:00
2 changed files with 7 additions and 8 deletions
Showing only changes of commit 41ddc86961 - Show all commits

View File

@ -13,12 +13,12 @@ class StartupTemplate(TemplateFileABC):
self._value = textwrap.dedent("""\
from cpl.application import StartupABC
from cpl.configuration import ConfigurationABC
from cpl.dependency_injection import ServiceProviderABC
from cpl.dependency_injection import ServiceProviderABC, ServiceCollectionABC
class Startup(StartupABC):
def __init__(self, config: ConfigurationABC, services: ServiceProviderABC):
def __init__(self, config: ConfigurationABC, services: ServiceCollectionABC):
StartupABC.__init__(self)
self._configuration = config
@ -29,8 +29,7 @@ class StartupTemplate(TemplateFileABC):
return self._configuration
def configure_services(self) -> ServiceProviderABC:
return self._services
return self._services.build_service_provider()
""")
@property

View File

@ -1,11 +1,11 @@
from cpl.application import StartupABC
from cpl.configuration import ConfigurationABC
from cpl.dependency_injection import ServiceProviderABC
from cpl.dependency_injection import ServiceProviderABC, ServiceCollectionABC
class Startup(StartupABC):
def __init__(self, config: ConfigurationABC, services: ServiceProviderABC):
def __init__(self, config: ConfigurationABC, services: ServiceCollectionABC):
StartupABC.__init__(self)
self._configuration = config
@ -16,5 +16,5 @@ class Startup(StartupABC):
return self._configuration
def configure_services(self) -> ServiceProviderABC:
return self._services
return self._services.build_service_provider()