Esempio n. 1
0
 public static void RegisterServices(this ContainerBuilder builder)
 {
     if (GlobalApplicationSettings.IsDbExists)
     {
         var databaseSettings = ApplicationConfigsProvider.ProviderDatabaseConfig();
         builder.Register(scope => new SqlConnection(databaseSettings.DatabaseConnectionString)).As <IDbConnection>().InstancePerLifetimeScope();
     }
 }
Esempio n. 2
0
        private void LoadSettings()
        {
            bgw.ReportProgress(25);

            Thread.Sleep(850);

            CreateFolder();
            bgw.ReportProgress(75);

            if (ApplicationConfigsProvider.ProviderDatabaseConfig() == default)
            {
                DatabaseExists = false;
            }

            DatabaseExists = true;

            bgw.ReportProgress(100);
            Thread.Sleep(100);
        }