// Instantiate a SafeHandle instance. public ServiceContainer(string appDataDirectory) { this.AppDataDirectory = appDataDirectory; var directoryProvider = new ContentDirectoryProvider(this.AppDataDirectory); this.serviceContainer = new ConcurrentDictionary <Type, object>(); this.RegisterService <ILogProvider>(new LogProvider()); this.RegisterService <IModuleEnumerator>(new ModuleEnumerator(appDataDirectory)); this.RegisterService <IKestrelWebServerService>(new KestrelServerService(appDataDirectory, this.Get <ILogProvider>().GetLogger("kestrel"))); this.RegisterService <IGraphQLService>(new GraphQLRootSchema(this)); this.RegisterService <IContentDirectoryProvider>(directoryProvider); this.RegisterService <IServiceRegistrationProvider>(new ServiceRegistrationProvider(this)); this.RegisterService <IServiceEnumerator>(new ServiceEnumerator(this)); }
/// <inheritdoc /> public ServiceContainer(string appDataDirectory, string kestrelHostname) { this.AppDataDirectory = appDataDirectory; var directoryProvider = new ContentDirectoryProvider(this.AppDataDirectory); this.serviceContainer = new ConcurrentDictionary <Type, object>(); this.RegisterService <IPrivilegedServiceContainerAccessor>(this); this.RegisterService <ILogProvider>(new LogProvider()); this.RegisterService <IModuleEnumerator>(new ModuleEnumerator(appDataDirectory)); this.RegisterService <IKestrelWebServerService>(new KestrelServerService(appDataDirectory, kestrelHostname, this.Get <ILogProvider>().GetLogger("KestrelServer"))); this.RegisterService <IContentDirectoryProvider>(directoryProvider); this.RegisterService <IServiceRegistrationProvider>(new ServiceRegistrationProvider(this)); this.RegisterService <IServiceEnumerator>(new ServiceEnumerator(this)); this.RegisterService <IFileSystem>(new PhysicalFileSystem()); this.RegisterService <IAsyncJobQueueFactory>(new AsyncJobQueueFactory()); }