This commit is contained in:
Sven Heidemann 2021-03-26 13:16:40 +01:00
parent afb91c8f1f
commit 3c0dd00a99
4 changed files with 12 additions and 3 deletions

View File

@ -0,0 +1,2 @@
- dbContext!!!
- templates for better Di using!

View File

@ -21,7 +21,11 @@ from collections import namedtuple
# imports:
from .service_abc import ServiceABC
from .service_provider_old import ServiceProvider
from .service_collection import ServiceCollection
from .service_collection_abc import ServiceCollectionABC
from .service_descriptor import ServiceDescriptor
from .service_lifetime_enum import ServiceLifetimeEnum
from .service_provider import ServiceProvider
from .service_provider_abc import ServiceProviderABC
VersionInfo = namedtuple('VersionInfo', 'major minor micro')

View File

@ -49,6 +49,8 @@ class ServiceProvider(ServiceProviderABC):
else:
service_type = descriptor.service_type
break
sig = signature(service_type.__init__)
params = []
for param in sig.parameters.items():

View File

@ -2,6 +2,7 @@ from cpl.application.application_runtime_abc import ApplicationRuntimeABC
from cpl.application.startup_abc import StartupABC
from cpl.configuration.console_argument import ConsoleArgument
from cpl.configuration.configuration_abc import ConfigurationABC
from cpl.dependency_injection.service_collection_abc import ServiceCollectionABC
from cpl.dependency_injection.service_provider_abc import ServiceProviderABC
from cpl_cli.command.build_service import BuildService
from cpl_cli.command.generate_service import GenerateService
@ -22,7 +23,7 @@ from cpl_cli.publish.publisher_abc import PublisherABC
class Startup(StartupABC):
def __init__(self, config: ConfigurationABC, runtime: ApplicationRuntimeABC, services: ServiceProviderABC):
def __init__(self, config: ConfigurationABC, runtime: ApplicationRuntimeABC, services: ServiceCollectionABC):
StartupABC.__init__(self)
self._configuration = config
@ -80,4 +81,4 @@ class Startup(StartupABC):
self._services.add_transient(UpdateService)
self._services.add_transient(VersionService)
return self._services
return self._services.build_service_provider()