public virtual RecordsetList FetchRecordset(PluginService pluginService, bool addFields) { if(pluginService == null) { throw new ArgumentNullException("pluginService"); } var broker = new PluginBroker(); var outputDescription = broker.TestPlugin(pluginService); return outputDescription.ToRecordsetList(pluginService.Recordsets, GlobalConstants.PrimitiveReturnValueTag); }
public virtual RecordsetList FetchRecordset(PluginService pluginService, bool addFields) { if (pluginService == null) { throw new ArgumentNullException(nameof(pluginService)); } var broker = new PluginBroker(); var outputDescription = broker.TestPlugin(pluginService); var dataSourceShape = outputDescription.DataSourceShapes[0]; var recSet = outputDescription.ToRecordsetList(pluginService.Recordsets, GlobalConstants.PrimitiveReturnValueTag); if (recSet != null) { foreach (var recordset in recSet) { foreach (var field in recordset.Fields) { if (string.IsNullOrEmpty(field.Name)) { continue; } var path = field.Path; var rsAlias = string.IsNullOrEmpty(field.RecordsetAlias) ? "" : field.RecordsetAlias.Replace("()", ""); var value = string.Empty; if (!string.IsNullOrEmpty(field.Alias)) { value = string.IsNullOrEmpty(rsAlias) ? $"[[{field.Alias}]]" : $"[[{rsAlias}().{field.Alias}]]"; } if (path != null) { path.OutputExpression = value; var foundPath = dataSourceShape.Paths.FirstOrDefault(path1 => path1.OutputExpression == path.OutputExpression); if (foundPath == null) { dataSourceShape.Paths.Add(path); } else { foundPath.OutputExpression = path.OutputExpression; } } } } } return(recSet); }
public virtual RecordsetList FetchRecordset(PluginService pluginService, bool addFields) { if (pluginService == null) { throw new ArgumentNullException(nameof(pluginService)); } var broker = new PluginBroker(); var outputDescription = broker.TestPlugin(pluginService); var dataSourceShape = outputDescription.DataSourceShapes[0]; var recSet = outputDescription.ToRecordsetList(pluginService.Recordsets, GlobalConstants.PrimitiveReturnValueTag); if (recSet != null) { foreach (var recordset in recSet) { FetchRecordsetFields_PluginService(dataSourceShape, recordset); } } return(recSet); }