Пример #1
0
        public AutofacTest()
        {
            var connectionString = ConfigurationManager.ConnectionStrings["AppCnn"].ConnectionString;
            var ioCContainer     = ConfigurationManager.AppSettings["IoCContainer"];
            var dbORM            = ConfigurationManager.AppSettings["ORM"];

            serviceProvider = ContainerSetup.Init(ioCContainer, connectionString, dbORM);
        }
Пример #2
0
        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();
        }