コード例 #1
0
        static void Main(string[] args)
        {
            IocContainer.Configure();
            var programRunner = new ProgramService();

            programRunner.Execute();
        }
コード例 #2
0
        public TestVehicle()
        {
            var services = new ServiceCollection();

            IocContainer.Configure(services);
            var provider = services.BuildServiceProvider();

            _services = provider.GetService <IServicesDO>();
        }
コード例 #3
0
        /// <summary>
        /// Startup to load IoC container for the application.
        /// </summary>
        /// <param name="e">Event argument object</param>
        protected override void OnStartup(StartupEventArgs e)
        {
            base.OnStartup(e);

            IocContainer.Configure();

            Current.MainWindow = new MainWindow();
            Current.MainWindow.Show();
        }
コード例 #4
0
ファイル: Program.cs プロジェクト: li-yuelun/SqlSugar-autofac
        static void Main()
        {
            Application.EnableVisualStyles();
            Application.SetCompatibleTextRenderingDefault(false);


            //IocContainer.Register();
            IocContainer.Configure();
            //return;
            TestSugar();
        }
コード例 #5
0
ファイル: Program.cs プロジェクト: thwyster/VolvoTest
        static void Main(string[] args)
        {
            var services = new ServiceCollection();

            IocContainer.Configure(services);
            var provider = services.BuildServiceProvider();

            provider.GetService <ServicesApplication>();

            Thread.Sleep(Timeout.Infinite);
        }
コード例 #6
0
        public void TestConfigureKeyedOptions()
        {
            var ioc = new IocContainer();

            ioc.Configure(new TestOptions
            {
                IntValue    = 5,
                StringValue = "TEST",
            });
            ioc.Configure("opt2", new TestOptions
            {
                IntValue    = 123,
                StringValue = "OTHER TEST"
            });

            var svc = ioc.Resolve <TestServiceWithKeyedConfig>();

            Assert.IsNotNull(svc.Configuration.Value);
            Assert.AreEqual(123, svc.Configuration.Value.IntValue);
            Assert.AreEqual("OTHER TEST", svc.Configuration.Value.StringValue);
        }
コード例 #7
0
        public void TestConfigure()
        {
            var ioc = new IocContainer();

            ioc.Configure(new TestOptions
            {
                IntValue    = 5,
                StringValue = "TEST",
            });

            var svc = ioc.Resolve <TestService>();

            Assert.IsNotNull(svc.Configuration.Value);
            Assert.AreEqual(5, svc.Configuration.Value.IntValue);
            Assert.AreEqual("TEST", svc.Configuration.Value.StringValue);
        }