Ejemplo n.º 1
0
        private static ISchemeService CreateSchemeService()
        {
            var schemeLocator = FileSchemeLocator.CreateFromEnvVariable();

            var schemeHandlerFactory = new StrictSchemeServiceHandlerFactory(schemeLocator);

            return(new SchemeService(schemeHandlerFactory));
        }
        public static void RegisterSchemeService(this ServiceCollection serviceCollection)
        {
            serviceCollection.AddSingleton <ISchemeLocator>(factory =>
            {
                var schemeLocator = FileSchemeLocator.CreateFromEnvVariable();

                return(schemeLocator);
            });

            serviceCollection.AddSingleton <ISchemeService, SchemeService>();

            serviceCollection.AddSingleton <ISchemeServiceHandlerFactory, SchemeServiceHandlerFactory>();
        }
Ejemplo n.º 3
0
        protected virtual void RegisterSchemeService(IServiceCollection container)
        {
            container.AddSingleton <ISchemeLocator>(factory =>
            {
                var schemeLocator = FileSchemeLocator.CreateFromEnvVariable();

                return(schemeLocator);
            });

            container.AddSingleton <ISchemeService, SchemeService>();

            container.AddSingleton <ISchemeServiceHandlerFactory, SchemeServiceHandlerFactory>();
        }
Ejemplo n.º 4
0
        public static ISchemeLocator CreateSchemeLocator()
        {
            var schemeLocator = FileSchemeLocator.CreateFromEnvVariable();

            return(schemeLocator);
        }