public static void Add(this TableDto table, IEnumerable <object> values) { var newRow = table.NewRow(); foreach (var(column, value) in table.Columns.Zip(values, (column, value) => (column, value))) { newRow[column.Name] = value; } }
public TripleTableDto(IEnumerable <ColumnDto> columns, bool areHeaders = true) { //var columnList = columns.ToList(); Head = new TableDto(columns); if (areHeaders) { var row = Head.NewRow(); foreach (var column in columns) { row[column.Name] = column.Name.ToString(); } } Body = new TableDto(columns); Foot = new TableDto(columns); }
public static void Add(this TableDto table, params object[] values) => table.Add((IEnumerable <object>)values);