Esempio n. 1
0
        public ResultTable(ResultColumn[] columns, int?totalElements, Pagination pagination)
        {
            this.entityColumn = columns.Where(c => c.Column is _EntityColumn).SingleOrDefaultEx();
            this.columns      = columns.Where(c => !(c.Column is _EntityColumn) && c.Column.Token.IsAllowed() == null).ToArray();

            CreateIndices(columns);

            this.totalElements = totalElements;
            this.pagination    = pagination;
        }
Esempio n. 2
0
        public ResultTable(ResultColumn[] columns, int?totalElements, Pagination pagination)
        {
            this.entityColumn = columns.Where(c => c.Column is _EntityColumn).SingleOrDefaultEx();
            this.columns      = columns.Where(c => !(c.Column is _EntityColumn) && c.Column.Token.IsAllowed() == null).ToArray();

            int rowCount = columns.Select(a => a.Values.Count).Distinct().SingleEx(() => "Count");

            for (int i = 0; i < Columns.Length; i++)
            {
                Columns[i].Index = i;
            }
            this.rows = 0.To(rowCount).Select(i => new ResultRow(i, this)).ToArray();

            this.totalElements = totalElements;
            this.pagination    = pagination;
        }
Esempio n. 3
0
 public T GetValue <T>(ResultColumn column)
 {
     return((T)this[column] !);
 }
Esempio n. 4
0
 public object?this[ResultColumn column]
 {
     get { return(column.Values[Index]); }
 }