public SoodaDataSource OpenDataSource(Sooda.Schema.DataSourceInfo dataSourceInfo, IDbConnection connection) { foreach (SoodaDataSource dataSource in _dataSources) { if (dataSource.Name == dataSourceInfo.Name) { return(dataSource); } } SoodaDataSource ds = (SoodaDataSource)dataSourceInfo.CreateDataSource(); _dataSources.Add(ds); ds.Statistics = this.Statistics; ds.IsolationLevel = IsolationLevel; if (connection != null) { ds.Connection = connection; } else { ds.Open(); } if (_savingObjects) { ds.BeginSaveChanges(); } return(ds); }
public void RegisterDataSource(SoodaDataSource dataSource) { dataSource.Statistics = this.Statistics; dataSource.IsolationLevel = IsolationLevel; _dataSources.Add(dataSource); }