public GetTableInfoResponse GetTableInfo(string databaseName, string tableName, string tags = null) { var table = this.GetTable(databaseName, tableName); return(table.Dispatcher.Invoke(() => { var tableInfo = table.TableInfo; if (!string.IsNullOrWhiteSpace(tags)) { tableInfo = table.TableInfo.Filter((TagInfo)tags); } return GetTableInfoResponse.ConvertFrom(tableInfo); })); }
public GetTableInfoResponse[] GetTablesInfoByTableName(string databaseName, [FromBody] GetTableInfoByTableNameRequest request, string tags = null, string columnTags = null) { var tables = this.GetTables(databaseName, tags); var intersectTables = tables.Select(table => table.Dispatcher.Invoke(() => table.TableName)) .Intersect(request.TableNames, StringComparer.OrdinalIgnoreCase); return(intersectTables.Select(tableName => { var table = tables.First(o => o.Dispatcher.Invoke(() => o.TableName == tableName)); var tableInfo = table.Dispatcher.Invoke(() => table.TableInfo); if (!string.IsNullOrWhiteSpace(columnTags)) { tableInfo = tableInfo.Filter((TagInfo)columnTags); } return GetTableInfoResponse.ConvertFrom(tableInfo); }).ToArray()); }
public GetTableInfoResponse[] GetTablesInfo(string databaseName, string tags = null, string columnTags = null) { var tables = this.GetTables(databaseName, tags); return(tables.Select(table => { return table.Dispatcher.Invoke(() => { var tableInfo = table.TableInfo; if (!string.IsNullOrWhiteSpace(columnTags)) { tableInfo = table.TableInfo.Filter((TagInfo)columnTags); } return GetTableInfoResponse.ConvertFrom(tableInfo); }); }).ToArray()); }