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; }
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; }
public T GetValue <T>(ResultColumn column) { return((T)this[column] !); }
public object?this[ResultColumn column] { get { return(column.Values[Index]); } }