コード例 #1
0
ファイル: Services.cs プロジェクト: ndubul/Chillas
 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);
 }
コード例 #2
0
        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);
        }
コード例 #3
0
ファイル: Services.cs プロジェクト: tuga1975/Warewolf
        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);
        }