Beispiel #1
0
        public DataTableStore GetLookupTable(DataLookupSource source, List <string> columns)
        {
            var reader = new PipedriveDatasourceReader
            {
                APIToken = source.Config.ContainsKey("APIToken") ? source.Config["APIToken"] : APIToken,
                PageSize = source.Config.ContainsKey("PageSize") ? DataSchemaTypeConverter.ConvertTo <int>(source.Config["PageSize"]) : PageSize,
                List     = source.Config.ContainsKey("List") ? source.Config["List"] : source.Name
            };

            reader.Initialize(SecurityService);

            var defaultSchema = reader.GetDefaultDataSchema();

            reader.SchemaMap = new DataSchema();

            foreach (var dsi in defaultSchema.Map)
            {
                foreach (var column in columns)
                {
                    if (dsi.ColumnName.Equals(column, StringComparison.OrdinalIgnoreCase))
                    {
                        reader.SchemaMap.Map.Add(dsi.Copy());
                    }
                }
            }

            return(reader.GetDataTable());
        }
Beispiel #2
0
 public ConnectionProperties(PipedriveDatasourceReader reader)
 {
     _reader = reader;
 }