Exemplo n.º 1
0
        static void Main(string[] args)
        {
            //var bdi = new BasicDiExample();
            //bdi.Run();
            var us = new UsingFactory();

            us.Run("Testing testing 123");
        }
Exemplo n.º 2
0
        private void RunScopedResolutionTest(ServiceLifetime lifetime)
        {
            var result = SetupProviders(lifetime);

            // Resolve defaults
            using (var scope = result.Default.CreateScope())
            {
                _defaultConstructor = scope.ServiceProvider.GetService <UsingConstructor>();
                _defaultFactory     = scope.ServiceProvider.GetService <UsingFactory>();
            }

            // Resolve JobHost
            using (var scope = result.JobHost.CreateScope())
            {
                _jobHostConstructor = scope.ServiceProvider.GetService <UsingConstructor>();
                _jobHostFactory     = scope.ServiceProvider.GetService <UsingFactory>();
            }
        }