Пример #1
0
 public DbUpgradeManager(Database database, ILog log)
 {
     _database      = database;
     _log           = log;
     _app           = _database.DbModel.EntityApp;
     _dbInfoService = (IDbInfoService)_app.GetService(typeof(IDbInfoService));
 }
Пример #2
0
 public DbUpgradeManager(Database database, IActivationLog log)
 {
     _database      = database;
     _log           = log;
     _app           = _database.DbModel.EntityApp;
     _dbInfoService = _app.GetService <IDbInfoService>(throwIfNotFound: false);
 }
Пример #3
0
 public DbSettings(DbDriver driver, DbOptions options, 
     string connectionString,
     string schemaManagementConnectionString = null,
     DbUpgradeMode upgradeMode = DbUpgradeMode.NonProductionOnly,
     DbUpgradeOptions upgradeOptions = DbUpgradeOptions.Default,
     IDbInfoService dbInfoProvider = null,
     string dataSourceName = null,
     DbNamingPolicy namingPolicy = null)
     : this(new DbModelConfig(driver, options, namingPolicy), connectionString, schemaManagementConnectionString, 
       upgradeMode, upgradeOptions, dbInfoProvider, dataSourceName)
 {
 }
Пример #4
0
        /// <summary>
        /// 点击加载按钮
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void btnLoad_Click(object sender, EventArgs e)
        {
            IDbInfoService dbInfoService = AutofacTool.Resolve <IDbInfoService>();
            ReturnInfo <IList <TableInfo> > returnInfo = dbInfoService.Query(txtDataBase.Text, GetDbConnectionString(), cbxDataSourceType.SelectedItem.ToString());

            if (returnInfo.Success())
            {
                dgvTable.Tag        = cbxDataSourceType.SelectedItem.ToString();
                dgvTable.DataSource = returnInfo.Data;
            }
            else
            {
                MessageBox.Show(returnInfo.Msg);
            }
        }
Пример #5
0
 public LoggingEntityApp(string schema = "log", UserSessionSettings sessionSettings = null)
     : base("LoggingApp", CurrentVersion)
 {
     var area = base.AddArea(schema);
       var errorLog = new ErrorLogModule(area);
       OperationLog = new OperationLogModule(area);
       IncidentLog = new IncidentLogModule(area);
       TransactionLog = _transactionLogModule = new TransactionLogModule(area);
       WebCallLog = new WebCallLogModule(area);
       NotificationLog = new NotificationLogModule(area);
       LoginLog = new LoginLogModule(area);
       DbModelChangeLog = new DbUpgradeLogModule(area);
       SessionService = new UserSessionModule(area, sessionSettings);
       DbInfoService = new DbInfoModule(area);
       EventLogService = new EventLogModule(area);
 }
Пример #6
0
 // Use this constructor for shared db model (multi-tenant app aganst multiple identical databases)
 public DbSettings(DbModelConfig modelConfig, 
     string connectionString,
     string schemaManagementConnectionString = null,
     DbUpgradeMode upgradeMode = DbUpgradeMode.NonProductionOnly,
     DbUpgradeOptions upgradeOptions = DbUpgradeOptions.Default,
     IDbInfoService dbInfoProvider = null,
     string dataSourceName = null)
 {
     ModelConfig = modelConfig;
       ConnectionString = connectionString;
       SchemaManagementConnectionString = schemaManagementConnectionString ?? connectionString;
       UpgradeMode = upgradeMode;
       UpgradeOptions = upgradeOptions;
       DbInfoProvider = dbInfoProvider;
       DataSourceName = dataSourceName ?? DataSource.DefaultName;
 }