private static void RegisterServices(
            IServiceCollection serviceCollection,
            WebSiteOptions webSiteOptions)
        {
            if (serviceCollection == null)
            {
                throw new ArgumentNullException(nameof(serviceCollection));
            }

            if (webSiteOptions == null)
            {
                throw new ArgumentNullException(nameof(webSiteOptions));
            }

            // Register operations
            serviceCollection.AddTransient <IProfileActions, ProfileActions>();
            serviceCollection.AddTransient <IGetCurrentProfileAction, GetCurrentProfileAction>();
            serviceCollection.AddTransient <IAddProfileAction, AddProfileAction>();
            serviceCollection.AddTransient <IDockerOperations, DockerOperations>();
            serviceCollection.AddTransient <IStartDockerContainerOperation, StartDockerContainerOperation>();
            serviceCollection.AddTransient <IStopDockerContainerOperation, StopDockerContainerOperation>();

            // Register validator
            serviceCollection.AddTransient <IContainerValidator, ContainerValidator>();

            // Register factories
            serviceCollection.AddTransient <IDockerClientFactory, DockerClientFactory>();

            // Register global options
            serviceCollection.AddInstance(webSiteOptions);
        }
 public static IServiceCollection AddSimpleIdentityServerWebSite(
     this IServiceCollection serviceCollection,
     WebSiteOptions webSiteOptions)
 {
     RegisterServices(serviceCollection, webSiteOptions);
     return(serviceCollection);
 }
        public static IServiceCollection AddSimpleIdentityServerWebSite(
            this IServiceCollection serviceCollection,
            Action <WebSiteOptions> callbackOptions)
        {
            if (callbackOptions == null)
            {
                throw new ArgumentNullException(nameof(callbackOptions));
            }

            var webSiteOptions = new WebSiteOptions();

            callbackOptions(webSiteOptions);
            RegisterServices(serviceCollection, webSiteOptions);
            return(serviceCollection);
        }