public AutofacTest() { var connectionString = ConfigurationManager.ConnectionStrings["AppCnn"].ConnectionString; var ioCContainer = ConfigurationManager.AppSettings["IoCContainer"]; var dbORM = ConfigurationManager.AppSettings["ORM"]; serviceProvider = ContainerSetup.Init(ioCContainer, connectionString, dbORM); }
protected override void OnStartup(StartupEventArgs e) { base.OnStartup(e); var connectionString = ConfigurationManager.ConnectionStrings["AppCnn"].ConnectionString; var ioCContainer = ConfigurationManager.AppSettings["IoCContainer"]; var dbORM = ConfigurationManager.AppSettings["ORM"]; var serviceProvider = ContainerSetup.Init(ioCContainer, connectionString, dbORM); var mediator = serviceProvider.GetService <IMediator>(); var mainWindow = new MainWindow(mediator); mainWindow.ShowDialog(); }