static async Task Main(string[] args) { handler = new ConsoleEventDelegate(ConsoleEventCallback); SetConsoleCtrlHandler(handler, true); using (var scope = ConfigurationContainer.Configure().BeginLifetimeScope()) { var app = scope.Resolve <Application>(); await app.RunAsync(); } }
public void CallBackTest(string section) { string testString = "test"; int testInt = 75; var configurator = new ConfigurationContainer(this.GetConfiguration(testInt, testString, section)); ConfigurationItem result = null; configurator.Configure <ConfigurationItem>(section, item => { result = item; }); result.Should().NotBeNull(); result.TestInt.Should().Be(testInt); result.TestString.Should().Be(testString); }
public CommandsHandler() { var dbContext = ConfigurationContainer.Configure().Resolve <IDbContext>(); this._dbContext = dbContext; }