Ejemplo n.º 1
0
        private List <string> BuildColumnIndex(TableRuleConfig rule)
        {
            List <string> columnIndex = new List <string>();

            foreach (var ruleConfig in rule.Rules)
            {
                foreach (var col in ruleConfig.Columns)
                {
                    if (String.IsNullOrEmpty(col))
                    {
                        columnIndex.Add(col);
                    }
                }
            }
            return(columnIndex);
        }
Ejemplo n.º 2
0
        public TableConfig(string name, string dataNode, TableRuleConfig rule)
        {
            if (String.IsNullOrEmpty(name))
            {
                throw new ArgumentNullException("table name is null");
            }
            if (String.IsNullOrEmpty(dataNode))
            {
                throw new ArgumentNullException("data node is null");
            }

            this.TableName = name.ToUpper();
            var tmpDataNode = dataNode.Split(new char[] { ',' }, StringSplitOptions.RemoveEmptyEntries);

            if (tmpDataNode.Length == 0)
            {
                throw new ArgumentNullException("table data node is null");
            }
            this.DataNodes   = tmpDataNode.ToList();
            this.Rule        = rule;
            this.ColumnIndex = BuildColumnIndex(rule);
            this.HasRule     = this.Rule != null;
        }