2021.4 #19
@ -0,0 +1,2 @@
|
|||||||
|
- dbContext!!!
|
||||||
|
- templates for better Di using!
|
@ -21,7 +21,11 @@ from collections import namedtuple
|
|||||||
|
|
||||||
# imports:
|
# imports:
|
||||||
from .service_abc import ServiceABC
|
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
|
from .service_provider_abc import ServiceProviderABC
|
||||||
|
|
||||||
VersionInfo = namedtuple('VersionInfo', 'major minor micro')
|
VersionInfo = namedtuple('VersionInfo', 'major minor micro')
|
||||||
|
@ -49,6 +49,8 @@ class ServiceProvider(ServiceProviderABC):
|
|||||||
else:
|
else:
|
||||||
service_type = descriptor.service_type
|
service_type = descriptor.service_type
|
||||||
|
|
||||||
|
break
|
||||||
|
|
||||||
sig = signature(service_type.__init__)
|
sig = signature(service_type.__init__)
|
||||||
params = []
|
params = []
|
||||||
for param in sig.parameters.items():
|
for param in sig.parameters.items():
|
||||||
|
@ -2,6 +2,7 @@ from cpl.application.application_runtime_abc import ApplicationRuntimeABC
|
|||||||
from cpl.application.startup_abc import StartupABC
|
from cpl.application.startup_abc import StartupABC
|
||||||
from cpl.configuration.console_argument import ConsoleArgument
|
from cpl.configuration.console_argument import ConsoleArgument
|
||||||
from cpl.configuration.configuration_abc import ConfigurationABC
|
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.dependency_injection.service_provider_abc import ServiceProviderABC
|
||||||
from cpl_cli.command.build_service import BuildService
|
from cpl_cli.command.build_service import BuildService
|
||||||
from cpl_cli.command.generate_service import GenerateService
|
from cpl_cli.command.generate_service import GenerateService
|
||||||
@ -22,7 +23,7 @@ from cpl_cli.publish.publisher_abc import PublisherABC
|
|||||||
|
|
||||||
class Startup(StartupABC):
|
class Startup(StartupABC):
|
||||||
|
|
||||||
def __init__(self, config: ConfigurationABC, runtime: ApplicationRuntimeABC, services: ServiceProviderABC):
|
def __init__(self, config: ConfigurationABC, runtime: ApplicationRuntimeABC, services: ServiceCollectionABC):
|
||||||
StartupABC.__init__(self)
|
StartupABC.__init__(self)
|
||||||
|
|
||||||
self._configuration = config
|
self._configuration = config
|
||||||
@ -80,4 +81,4 @@ class Startup(StartupABC):
|
|||||||
self._services.add_transient(UpdateService)
|
self._services.add_transient(UpdateService)
|
||||||
self._services.add_transient(VersionService)
|
self._services.add_transient(VersionService)
|
||||||
|
|
||||||
return self._services
|
return self._services.build_service_provider()
|
||||||
|
Loading…
Reference in New Issue
Block a user