protected void OnDataStoreUpdateSchema(DataStoreUpdateSchemaEventArgs args) { if (DataStoreUpdateSchema != null) { DataStoreUpdateSchema(this, args); } }
public virtual UpdateSchemaResult UpdateSchema(bool dontCreateIfFirstTableNotExist, params DBTable[] tables) { foreach (var schemaUpdater in schemaUpdaters) { schemaUpdater.Update(this, new DataStoreUpdateSchemaEventArgs(dontCreateIfFirstTableNotExist, tables)); } var args = new DataStoreUpdateSchemaEventArgs(dontCreateIfFirstTableNotExist, tables); OnDataStoreUpdateSchema(args); return dataStoreCore.UpdateSchema(false, args.Tables); }
public void UpdateSchema(DataStoreUpdateSchemaEventArgs args) { foreach (KeyValuePair<IDataStore, List<DBTable>> dataStore in _dataStoreManager.GetDataStores(args.Tables)) { IDataStore store = dataStore.Key; List<DBTable> dbTables = dataStore.Value; store.UpdateSchema(false, dbTables.ToArray()); } args.Updated = true; }
public virtual UpdateSchemaResult UpdateSchema(bool dontCreateIfFirstTableNotExist, params DBTable[] tables) { foreach (var schemaUpdater in SchemaUpdaters) { schemaUpdater.Update(this, new DataStoreUpdateSchemaEventArgs(dontCreateIfFirstTableNotExist, tables)); } var args = new DataStoreUpdateSchemaEventArgs(dontCreateIfFirstTableNotExist, tables); OnDataStoreUpdateSchema(args); return(_dataStoreCore.UpdateSchema(false, args.Tables)); }
public void UpdateSchema(DataStoreUpdateSchemaEventArgs args) { foreach (KeyValuePair <IDataStore, DataStoreInfo> dataStore in _dataStoreManager.GetDataStores(args.Tables)) { IDataStore store = dataStore.Key; List <DBTable> dbTables = dataStore.Value.DbTables; store.UpdateSchema(false, dbTables.ToArray()); } args.Updated = true; }
public void Update(ConnectionProviderSql connectionProviderSql, DataStoreUpdateSchemaEventArgs dataStoreUpdateSchemaEventArgs) { if (connectionProviderSql is AccessConnectionProvider) return; lock (connectionProviderSql.SyncRoot) { if (!connectionProviderSql.CanCreateSchema) return; try { if (dataStoreUpdateSchemaEventArgs.UpdateSchemaResult == UpdateSchemaResult.SchemaExists) UpdateColumnSize(dataStoreUpdateSchemaEventArgs.Tables, connectionProviderSql); } catch (System.Exception e) { System.Diagnostics.Trace.TraceError(e.ToString()); } } }
public void Update(ConnectionProviderSql connectionProviderSql, DataStoreUpdateSchemaEventArgs dataStoreUpdateSchemaEventArgs) { if (connectionProviderSql == null || Disabled) { return; } using (((IDisposable)((AsyncLockHelper)connectionProviderSql.GetPropertyValue("LockHelper")).CallMethod("Lock"))) { if (!connectionProviderSql.CanCreateSchema) { return; } try { if (dataStoreUpdateSchemaEventArgs.UpdateSchemaResult == UpdateSchemaResult.SchemaExists) { UpdateColumnSize(dataStoreUpdateSchemaEventArgs.Tables, connectionProviderSql); } } catch (Exception e) { Trace.TraceError(e.ToString()); } } }
public void Update(ConnectionProviderSql connectionProviderSql, DataStoreUpdateSchemaEventArgs dataStoreUpdateSchemaEventArgs) { if (connectionProviderSql == null || connectionProviderSql is AccessConnectionProvider || Disabled) { return; } lock (connectionProviderSql.SyncRoot) { if (!connectionProviderSql.CanCreateSchema) { return; } try { if (dataStoreUpdateSchemaEventArgs.UpdateSchemaResult == UpdateSchemaResult.SchemaExists) { UpdateColumnSize(dataStoreUpdateSchemaEventArgs.Tables, connectionProviderSql); } } catch (System.Exception e) { System.Diagnostics.Trace.TraceError(e.ToString()); } } }
protected void OnDataStoreUpdateSchema(DataStoreUpdateSchemaEventArgs args) { DataStoreUpdateSchema?.Invoke(this, args); }