private IQueryImporter GetQueryImporter(string tableName, bool remote) { var d = new DestinationTableParameters(); d.Table = new Jhu.Graywulf.Schema.Table() { Dataset = new Jhu.Graywulf.Schema.SqlServer.SqlServerDataset("", Test.Constants.TestConnectionString), SchemaName = "dbo", TableName = tableName }; d.Operation = DestinationTableOperation.Create; var s = new SourceQueryParameters(); s.Dataset = new Jhu.Graywulf.Schema.SqlServer.SqlServerDataset("TEST", Test.Constants.TestConnectionString); s.Query = "SELECT 1 AS one, 2 AS two, 3 AS three"; IQueryImporter q = null; if (remote) { q = RemoteServiceHelper.CreateObject<IQueryImporter>(Test.Constants.Localhost); } else { q = new QueryImporter(); } q.Source = s; q.Destination = d; return q; }
protected IQueryImporter CreateQueryImporter(SourceQueryParameters source, DestinationTableParameters destination, bool local) { var desthost = GetHostnameFromSqlConnectionString(destination.Table.Dataset.ConnectionString); IQueryImporter qi; if (local) { qi = new QueryImporter(); } else { qi = RemoteServiceHelper.CreateObject<IQueryImporter>(desthost); } qi.Source = source; qi.Destination = destination; return qi; }