static void Main(string[] args) { IocContainer.Configure(); var programRunner = new ProgramService(); programRunner.Execute(); }
public TestVehicle() { var services = new ServiceCollection(); IocContainer.Configure(services); var provider = services.BuildServiceProvider(); _services = provider.GetService <IServicesDO>(); }
/// <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(); }
static void Main() { Application.EnableVisualStyles(); Application.SetCompatibleTextRenderingDefault(false); //IocContainer.Register(); IocContainer.Configure(); //return; TestSugar(); }
static void Main(string[] args) { var services = new ServiceCollection(); IocContainer.Configure(services); var provider = services.BuildServiceProvider(); provider.GetService <ServicesApplication>(); Thread.Sleep(Timeout.Infinite); }
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); }
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); }