This commit is contained in:
Zeeshaun
2026-04-20 14:47:24 -05:00
parent 89057eceea
commit 8b3ea92501
485 changed files with 71042 additions and 0 deletions
@@ -0,0 +1,26 @@
using System;
using System.Collections.Generic;
using System.Linq;
using LCU.API.Collections.RepoApi.Models.Reporting;
using LCU.Shared.Collections.RepoApiLib.Models.Reporting.Responses;
namespace LCU.Shared.Collections.RepoApiLib.Formatting
{
public static class DataTableFormatting
{
public static DataTable CreateDataTable<T>(IEnumerable<T> dataRows, Func<T, int> repoID, params Func<T, ReportHeaderCellMap>[] columns)
{
return new DataTable()
{
Headers = columns.Select(column => column(default(T)).Header).ToArray(),
Rows = dataRows.Select(entry => new RepoAccountReferenceRow()
{
RepoId = repoID(entry),
Cells = columns.Select(column => column(entry).Cell).ToArray()
})
};
}
}
}