public IEnumerator<SqlScript> GetEnumeratorFor(string tableName) { var i = 1; var path = String.Format(SqlFileNameFormat, _scriptDirectory, tableName, i); while (File.Exists(path)) { SqlScript script; using (var reader = File.OpenText(path)) { script= new SqlScript(path, reader.ReadToEnd()); } yield return script; i++; path = String.Format(SqlFileNameFormat, _scriptDirectory, tableName, i); } }
private void ExecuteScriptIfNotEmpty(SqlScript script) { _logger.Log(script.Name + "\n"); if (!string.IsNullOrWhiteSpace(script.Script)) _queryExecutor.ExecuteNonQueryStatement(script.Script); }