Пример #1
0
        protected override TableConfig NormalizeTableConfigParameters(TableConfig tableConfig)
        {
            var normalizedTableConfig = new TableConfig
            {
                ConstantColumns = tableConfig.ConstantColumns?.Select(c =>
                                                                      new ConstantColumnConfig {
                    Name = ParameterNameHelper.RemoveParenthesises(c.Name), Value = c.Value
                }).ToList()
                                  ?? new List <ConstantColumnConfig>(),

                ScrambledColumns = tableConfig.ScrambledColumns?.Select(c =>
                                                                        new ScrambledColumnConfig {
                    Name = ParameterNameHelper.RemoveParenthesises(c.Name)
                }).ToList()
                                   ?? new List <ScrambledColumnConfig>(),

                PairedColumnsInsideTable = tableConfig.PairedColumnsInsideTable?
                                           .Select(l => ParameterNameHelper.RemoveParenthesisesFromStringList(l)).ToList()
                                           ?? new List <List <string> >(),

                PairedColumnsOutsideTable = tableConfig.PairedColumnsOutsideTable?
                                            .Select(p =>
                                                    new PairedColumnsOutsideTableConfig
                {
                    ColumnMapping     = p.ColumnMapping.Select(l => ParameterNameHelper.AddParenthesisesToStrList(l)).ToList(),
                    SourceDestMapping = p.SourceDestMapping.Select(s =>
                                                                   new SourceDestMappingStepConfig
                    {
                        DestinationLinkedInstance   = ParameterNameHelper.AddParenthesises(s.DestinationLinkedInstance),
                        DestinationConnectionString = s.DestinationConnectionString,
                        DestinationFullTableName    = ParameterNameHelper.AddParenthesisToFullTableName(s.DestinationFullTableName),
                        ForeignKeyMapping           = s.ForeignKeyMapping.Select(l => ParameterNameHelper.AddParenthesisesToStrList(l)).ToList()
                    }).ToList()
                }).ToList()
                                            ?? new List <PairedColumnsOutsideTableConfig>(),

                FullTableName = ParameterNameHelper.AddParenthesisToFullTableName(tableConfig.FullTableName),
                Where         = tableConfig.Where
            };

            return(normalizedTableConfig);
        }
Пример #2
0
 protected override IEnumerable <string> GetNormalizedColumnListCopy(IEnumerable <string> columns)
 {
     return(ParameterNameHelper.RemoveParenthesisesFromStringList(columns.ToList()));
 }