internal ContainerRuntime(
            IRegistrationSource registrationSource,
            IContainerBackend backend)
        {
            _registrationSource = registrationSource ?? throw new ArgumentNullException(nameof(registrationSource));
            _backend            = backend ?? throw
                                      new ArgumentNullException(nameof(backend));

            // We create a runtime scope to handle the storage and retrieval of singleton services.
            _runtimeScope = (ContainerScope)CreateScope();
        }
Beispiel #2
0
        public IContainerBuilder UseBackend(IContainerBackend backend)
        {
            _backend = backend ?? throw new ArgumentNullException(nameof(backend));

            return(this);
        }
 internal ContainerScope(IScopeContext scopeContext, IContainerBackend backend, ContainerRuntime runtime)
 {
     _scopeContext = scopeContext ?? throw new ArgumentNullException(nameof(scopeContext));
     _backend      = backend ?? throw new ArgumentNullException(nameof(backend));
     _runtime      = runtime ?? throw new ArgumentNullException(nameof(runtime));
 }
Beispiel #4
0
 public ContainerBuilder()
 {
     _registrationSource = new DefaultRegistrationSource();
     _backend            = new DefaultContainerBackend();
 }