Example #1
0
        protected PatternTable <TRow> AddCustomTable <TRow>(string name, IList <TRow> collectionProperty)
        {
            var table = new PatternTable <TRow>(name);

            try {
                table.DataRows = collectionProperty;
            } catch (NullReferenceException ex) {
                logger.Warn(ex, "При получении строк таблицы {0}, произошло исключение NullReferenceException.", name);
            }

            customTablesList.Add(table);
            return(table);
        }
Example #2
0
        protected PatternTable <TDoc, TRow> AddTable <TRow>(string name, Expression <Func <TDoc, IList <TRow> > > collectionProperty)
        {
            var table = new PatternTable <TDoc, TRow>(name)
            {
                RootObject = RootObject,
            };

            if (RootObject != null)
            {
                try{
                    table.DataRows = collectionProperty.Compile().Invoke(RootObject);
                }
                catch (NullReferenceException ex)
                {
                    logger.Warn(ex, "При получении строк таблицы {0}, произошло исключение NullReferenceException.", name);
                }
            }

            tablesList.Add(table);
            return(table);
        }
Example #3
0
        protected PatternTable <TDoc, TRow> AddTable <TRow>(Expression <Func <TDoc, IList <TRow> > > collectionProperty)
        {
            var name = PatternTable <TDoc, TRow> .GetCollectionName(collectionProperty);

            return(AddTable(name, collectionProperty));
        }